The carbon dioxide (CO2) content of the atmosphere has varied cyclically between ~180 and ~280 parts per million by volume over the past 800,000 years, closely coupled with temperature and sea level. For earlier periods in Earth’s history, the partial pressure of CO2 (pCO2) is much less certain, and the relation between pCO2 and climate remains poorly constrained. We use boron/calcium ratios in foraminifera to estimate pCO2 during major climate transitions of the past 20 million years. During the Middle Miocene, when temperatures were ~3° to 6°C warmer and sea level was 25 to 40 meters higher than at present, pCO2 appears to have been similar to modern levels. Decreases in pCO2 were apparently synchronous with major episodes of glacial expansion during the Middle Miocene (~14 to 10 million years ago) and Late Pliocene (~3.3 to 2.4 million years ago).