A lunar rock brought back to Earth in 1971 has provided researchers with memento of the Moon's magnetic field as it might have been just a billion years ago.

The discovery suggests our nearest neighbour was still slightly molten on the inside 1 to 2.5 billion years after it was assumed to be frozen solid, a find that could have implications in our search for life on other worlds.

US researchers from MIT, Rutgers University, and University of California, Berkeley, found a rock sample brought back by Apollo 15 astronauts had captured evidence of a magnetic field measuring about 5 microteslas.

This puts it on the scale of a magnetic field about 30 centimetres (1 foot) away from an operating microwave oven, so it's not all that strong.

In fact, our own planet's magnetic field at the surface is about five to thirteen times that, ranging from 25 to 65 microteslas.

The difference is Earth has a dense, rotating core of iron and nickel surrounded by flowing rock that keeps charged particles moving in what's called a dynamo.

It's possible that we should be thankful for the Moon's gravitational grunt keeping our planet's gooey insides sloshing about for so long, but the poor Moon itself had no hope, eventually turning as solid as a marble.

It wasn't always that way.

Following its formation in the wake of a massive collision between Earth Mark I and a Mars-sized object about 4.5 billion years ago, the Moon also had molten guts that rolled and churned enough to give it a relatively strong magnetic field of up to 70 microteslas.

Over time, as the Moon chilled, its field weakened. When the Apollo astronauts tested the Moon's surface just under half a century ago they found it was virtually zip, about 100 times lower than Earth's.

Since the Moon is smaller and less dense than our planet, it's no mystery as to why the magnetic field eventually vanished.

What is a mystery is why it stuck around for as long as it did. Roughly 3.56 billion years ago, the Moon's magnetic field was at peak strength before it started to fade to about 4 microteslas about 400 million years later.

Oddly, its molten core should have locked up around half a billion years earlier. Something had been keeping it ticking.

"The concept of a planetary magnetic field produced by moving liquid metal is an idea that is really only a few decades old," says MIT researcher Benjamin Weiss.

"What powers this motion on Earth and other bodies, particularly on the moon, is not well-understood. We can figure this out by knowing the lifetime of the lunar dynamo."

Constant meteorite impacts could have played a small role in giving the Moon more heat energy, though the barrage of space rocks had quietened significantly well before 3.56 billion years ago.

A second idea suggests the Moon 'wobbled' more when it was closer to the Earth, keeping its insides shaken until it moved further away.

Another possibility is heat arising from the crystallisation of minerals in its core might have been enough to keep convection turning over, pushing those charged particles around enough to generate a field.

Part of the problem is we know don't quite know when the Moon's dynamo ground to a complete halt, largely because there aren't a lot of fresh rock samplings melting and solidifying after 3 billion years ago.

In this latest research, the scientists took Apollo 15 mission samples of basalt from a crater rim within eastern Mare Imbrium in the Moon's northern hemisphere which had been dated to around 3.3 billion years old.

The basalt contained glassy fragments that were caused when a meteorite plowed into the Moon nearby about 1 to 2.5 billion years ago.

These fragments would have melted and then quickly cooled, allowing its iron atoms to realign under the influence of any potential magnetic field.

Testing that magnetism showed that in spite of the time that had passed, there was still a weak but non-zero field present.

"We didn't think that small planetary bodies could generate magnetic fields for a very long time because they have smaller cores that would cool quickly and crystallise early in their lifetimes," says researcher Sonia Tikoo from Rutgers University, New Brunswick.

The find implies the Moon must have had two mechanisms powering its dynamo – one in its youth, and something else that dragged on the generation of a magnetic field for a lot longer.

So far the slow-crystallisation of the core hypothesis seems to be the most popular, but more research will be needed to better gauge the composition of the Moon's core.

The discovery could help us to better understand why planets like Mercury still have a magnetic field, while worlds like Mars don't.

Since a magnetic field is incredibly useful for life on this planet, knowing from afar which exoplanets are likely to have one could help narrow down our hunt for life elsewhere in the Universe.

"Whenever we look at exoplanets or the moons of exoplanets that could be in the habitable zone, we can consider the magnetic field as an important player in habitability," says Tikoo.

This research was published in Science Advances.