Decades of speculation about a warmer, wetter Mars climate in the planet’s first billion years postulate a denser CO2-rich atmosphere than at present. Such an atmosphere should have led to the formation of outcrops rich in carbonate minerals, for which evidence has been sparse. Using the Mars Exploration Rover Spirit, we have now identified outcrops rich in magnesium-iron carbonate (16 to 34 weight percent) in the Columbia Hills of Gusev crater. Its composition approximates the average composition of the carbonate globules in martian meteorite ALH 84001. The Gusev carbonate probably precipitated from carbonate-bearing solutions under hydrothermal conditions at near-neutral pH in association with volcanic activity during the Noachian era.