The evolution and escape of the martian atmosphere and the planet's water inventory can be separated into an early and late evolutionary epoch. The first epoch started from the planet's origin and lasted $\sim$500 Myr. Because of the high EUV flux of the young Sun and Mars' low gravity it was accompanied by hydrodynamic blow-off of hydrogen and strong thermal escape rates of dragged heavier species such as O and C atoms. After the main part of the protoatmosphere was lost, impact-related volatiles and mantle outgassing may have resulted in accumulation of a secondary CO$_2$ atmosphere of a few tens to a few hundred mbar around $\sim$4--4.3 Gyr ago. The evolution of the atmospheric surface pressure and water inventory of such a secondary atmosphere during the second epoch which lasted from the end of the Noachian until today was most likely determined by a complex interplay of various nonthermal atmospheric escape processes, impacts, carbonate precipitation, and serpentinization during the Hesperian and Amazonian epochs which led to the present day surface pressure.