An ancient Martian ocean held more water than the Arctic Ocean on Earth, scientists believe.
It once covered what is now the planet's arid northern plains and would have contained at least 20 million cubic kilometres (12.4 million cubic miles) of water.
That was during the planet's wet Noachian period, which ended about 3.7 billion years ago when life was just emerging on Earth.
Since then, 87% of the water has been lost to space, according to the new research reported in the journal Science.
Scientists from the American space agency Nasa made the discovery after measuring atomic signatures of water in the Martian atmosphere using powerful Earth telescopes.
They determined that young Mars would have had enough water to cover the whole of its surface in a layer 137 metres (450 feet) deep.
But it was much more likely that the water filled an ocean occupying almost half of Mars's northern hemisphere, reaching depths of greater than one mile (1.6 kilometres) in some regions.
Lead researcher Dr Geronimo Villanueva, from Nasa's Goddard Space Flight Centre in Greenbelt, Maryland, said: "Our study provides a solid estimate of how much water Mars once had, by determining how much water was lost to space.
"With this work, we can better understand the history of water on Mars."
The scientists produced maps showing the distribution of normal water in the Martian atmosphere and "heavy" water containing deuterium, a more massive form of hydrogen. By analysing the ratio of "heavy" to regular water they showed that Mars must have lost a volume of water 6.5 times larger than the amount trapped in the present day polar ice caps.
An ancient ocean containing the lost water would have covered 19% of the planet's surface.
It would have had a greater volume than the Arctic Ocean, which contains 18,750,000 cubic kilometres (11.7 million cubic miles) of water.
By comparison, the Atlantic Ocean covers 17% of the surface of the Earth and contains more than 310 million cubic kilometres (192.6 million cubic miles).
Co-author Dr Michael Mumma, also from the Goddard Space Flight Centre, said: "With Mars losing that much water, the planet was very likely wet for a longer period of time than was previously thought, suggesting the planet might have been habitable for longer."
The research was carried out using two telescopes at the Keck Observatory on Hawaii and the European Southern Observatory's Very Large Telescope in Chile.