It's a longstanding mystery: how Mars lost the water that flowed across its surface billions of years ago.

Scientists now think they have an answer: much of it became trapped in the planet's outer layer - its crust.

The ancient water exists in the form of minerals contained within Martian rocks.

The findings have been discussed at the 52nd Lunar and Planetary Science Conference and are published in Science journal.

The study used measurements gathered from Mars-orbiting spacecraft, rovers and meteorites.

Researchers then developed a computer simulation of how water was lost from the planet over time.

More than four billion years ago, Mars was warmer and wetter - possibly with a thicker atmosphere. Water coursed through rivers, cutting channels in the rock, and pooled in impact craters.