This illustration shows one suggested mechanism for creating an ancient magnetic field on the moon. In this scenario, impacting space rocks on the moon would create instability in the moon's core that could lead to a dynamo that creates a magnetic field.
The moon generated a surprisingly intense magnetic field until at least 3.56 billion years ago, 160 million years longer than previously thought, a new study reports.
These findings could shed light not just on the magnetic field of the moon, which is now extremely weak, but on that of asteroids and other distant worlds, investigators added.
Earth's magnetic field is created by its internal dynamo, which itself is generated by the planet's churning molten metal core. Research increasingly suggests that the moon once had a dynamo as well, with evidence of magnetism found in lunar rocks returned by Apollo astronauts. [10 Surprising Moon Facts]
For the rest of the story: http://www.livescience.com/29514-moon-magnetic-field-mystery.html