Data gathered by NASA's Messenger spacecraft suggests that Mercury, seen here in a topographically colored image, had a magnetic field even when it was just 700 million years old. NASA/Johns Hopkins University Applied Physics Laboratory/Carnegie Institution of Washington

Messenger’s four-year mission at Mercury ended last week when the NASA spacecraft was deliberately crashed on the surface of the planet. Now, the treasure trove of data gathered by the spacecraft before its demise is helping scientists answer questions about the solar system’s innermost planet in unprecedented detail.

Based on magnetic field measurements taken by the Messenger at an altitude as low as 9 miles, scientists have now discovered that Mercury, located just 36 million miles from the sun, possesses a magnetic field dating back almost four billion years. At that time, the planet was just 700 million years old, scientists said in the findings published earlier this week in the journal Science.

“The science from these recent observations is really interesting and what we’ve learned about the magnetic field is just the first part of it,” Catherine Johnson, a planetary scientist at the University of British Columbia in Vancouver and lead author of the study, said in a statement.

Much like Earth, Mercury’s magnetic field is believed to be generated as a result of the “dynamo effect,” caused by the circulation of liquid iron deep inside its core. Mercury is the only planet besides Earth in the inner solar system to have such a magnetic field.

While scientists have long known that Mercury has a magnetic field similar to that of Earth’s, albeit a much weaker one, they did not know how old this field was. When the Messenger flew close to the planet, its magnetometer detected trace signals of magnetization in the crust. Studying the number of impact craters to calculate the age of these regions on the surface, scientists estimated that the planet’s magnetic field is very ancient -- at least 3.7 billion to 3.9 billion years old.

“The strength of Mercury's magnetic field may have ranged anywhere from its strength today to something about 100 times stronger, comparable to the strength of Earth's magnetic field at Earth's surface today,” Johnson told Mercury’s present-day magnetic field is extremely weak -- about 1 percent the strength of Earth’s field.

“Being able to pin down how long Mercury has had a magnetic field helps us narrow down scenarios for the early history of Mercury and how it has changed over time," Johnson reportedly said.