The High Resolution Imaging Science Experiment (HiRISE) camera on NASA's Mars Reconnaissance Orbiter took two images of the larger of Mars' two moons, Phobos, within 10 minutes of each other on March 23, 2008. This is the first.NASA/JPL-Caltech/University of Arizona

Mars is host to two moons, small, colourful and mysterious. Astronomers now believe that the long-standing debate of their origin has finally been settled.

The shapes and colours of Martian moons Phobos and Deimos as well as their make led astronomers to always think that the moons were, in fact, asteroids that were pulled into orbit by Mars' gravity.

The moons also seemingly resemble primitive asteroids from the outer solar system, notes a report by the American Geophysical Union because of its dark faces, but its shapes and angles do not match with this description, so it has remained a mystery, notes the report.

Going back on data that is about 20 years old, collected by the Mars Global Surveyor mission has lead astronomers to once again believe that the moons of Mars were formed after a massive impact on the planet, ejected enough rock into orbit to form not one, but two moons. This is the same way in which the Earth's Moon is believed to have formed.

The dataset had several clues as to what the crust of Phobos is composed of and it appears to be more similar to the surface of Mars than not.

These color-enhanced views of Deimos, the smaller of the two moons of Mars, were taken on Feb. 21, 2009, by the High Resolution Imaging Science Experiment (HiRISE) camera on NASA's Mars Reconnaissance Orbiter. Deimos is about 7.5 miles in diameterNASA/JPL-Caltech/University of Arizona

"The fun part for me has been taking a poke at some of the ideas out there using an old dataset that's has been underutilized," said Tim Glotch, of the Stony Brook University in New York- lead author of the new study.

Marc Fries, planetary scientists from NASA's Johnson Space Center who was not involved in the study spoke of how the issue of the origins of Phobos and Deimos is a fun sort of mystery because there are two competing hypotheses and only one of them can be true.

"I would not consider this to be a final solution to the mystery of the moons' origin, but it will help keep the discussion moving forward."

The new study, explains the AGU, does not really argue that Phobos is made only of materials that originated on Mars, however, new results demonstrate that the moon contains a piece of Martian crust. This could be a result of a mixture of debris from the Mars as well as remnants of the massive object that rammed into the Red planet sometime in the past.

The study was first published in the Journal of Geophysical Research: Planets, a publication of the American Geophysical Union.