A low battery could have caused it, not totally sure about this but I think the ecu senses the low voltage and turns off non essential stuff, this then causes the engine light to come on.
I have also heard it can happen from a loose connection, if you keep the battery charged up and it happens again check all the connections for tightness/corrosion.