Recent observations and missions to Mars have provided us with new insight into the past habitability of Mars and its history. At the same time they have raised many questions on the planet evolution. We show that even with the few data available we can propose a scenario for the evolution of the Martian atmosphere in the last three billion years. Our model is obtained with a back integration of the Martian atmosphere, and takes into account the effects of volcanic degassing, which constitutes an input of volatiles, and atmospheric escape into space. We focus on CO2, the predominant Martian atmospheric gas. Volcanic CO2 degassing rates are obtained for different models of numerical model crust production rates [Breuer, D., Spohn, T. 2003. Early plate tectonics versus single-plate tectonics on Mars: Evidence from magnetic field history and crust evolution. J. Geophys. Res. - Planets, 108, E7,5072, Breuer, D., Spohn, T., 2006. Viscosity of the Martian mantle and its initial temperature: Constraints from crust formation history and the evolution of the magnetic field. Planet. Space Sci. 54 (2006) 153-169: Manga, M., Wenzel, M., Zaranek, S.E., 2006. Mantle Plumes and Long-lived Volcanism on Mars as Result of a Layered Mantle. American Geophysical Union Fall Meeting 2006, Abstract #P31C-0149.] and constrained on observation. By estimating the volatile contents of the lavas, the amount of volatiles released in the atmosphere is estimated for different scenarios. Both nonthermal processes (related to the solar activity) and thermal processes are studied and non-thermal processes are incorporated in our modelling of the escape [Chassefiere, E., Leblanc, F., Langlais, B., 2006, The combined effects of escape and magnetic field history at Mars. Planet. Space Sci. Volume 55, Issue 3, Pages 343-357.]. We used measurements from ASPERA and Mars Express and these models to estimate the amount of lost atmosphere. An evolution of the CO2 pressure consistent with its present state is then obtained. A crustal production rate of at least 0.01 km(3)/year is needed for the atmosphere to be at steady state. Moreover, we show that for most of the scenarios a rapid loss of the primary (and primordial) atmosphere due to atmospheric escape is required in the first 2 Gyr in order to obtain the present-day atmosphere. When CO2 concentration in the mantle is high enough (i.e. more than 800 ppm), our results imply that present-day atmosphere would have a volcanic origin and would have been created between I Gyr and 2 Gyr ago even for models with low volcanic activity. If the volcanic activity and the degassing are intense enough, then the atmosphere can even be entirely secondary and as young as 1 Gyr. However, with low activity and low CO2 concentration (less than 600 ppm), the present-day atmosphere is likely to be for the major part primordial. (C) 2008 Elsevier B.V. All rights reserved.