The relationship between atmospheric carbon dioxide (CO2) and climate in the Quaternary period has been extensively investigated, but the role of CO2 in temperature changes during the rest of Earth's history is less clear. The range of geological evidence for cool periods during the high CO2 Mesozoic `greenhouse world' of high atmospheric CO2 concentrations, indicated by models and fossil soils, has been particularly difficult to interpret. Here, we present high-resolution records of Mesozoic and early Cenozoic atmospheric CO2 concentrations from a combination of carbon-isotope analyses of non-vascular plant (bryophyte) fossils and theoretical modelling. These records indicate that atmospheric CO2 rose from ~420p.p.m.v. in the Triassic period (about 200 million years ago) to a peak of ~1,130p.p.m.v. in the Middle Cretaceous (about 100 million years ago). Atmospheric CO2 levels then declined to ~680p.p.m.v. by 60 million years ago. Time-series comparisons show that these variations coincide with large Mesozoic climate shifts, in contrast to earlier suggestions of climate-CO2 decoupling during this interval. These reconstructed atmospheric CO2 concentrations drop below the simulated threshold for the initiation of glaciations on several occasions and therefore help explain the occurrence of cold intervals in a `greenhouse world'.