Observations suggest that Mars was wet and warm during the late Noachian, which probably requires a dense CO2 atmosphere. But would a dense CO2 early Martian atmosphere have been stable under the strong EUV flux from the young Sun? Here we show that thermal escape of carbon was so efficient during the early Noachian, 4.1 billion years ago (Ga), that a CO2-dominated Martian atmosphere could not have been maintained, and Mars should have begun its life cold. By the mid to late Noachian, however, the solar EUV flux would have become weak enough to allow a dense CO2 atmosphere to accumulate. Hence, a sustainable warm and wet period only appeared several hundred million years (Myrs) after Mars formed.