Some water remains on Mars today, but mostly as ice at the polar ice caps or underground. Most of Mars' water was lost because the planet lost its magnetic field early in its history around 4 billion years ago. Without a magnetic field to shield the planet from the solar wind, the solar wind eroded much of the Martian atmosphere and carried any water and volatile gases away into space.