Mass extinction at the Cretaceous-Paleogene (K-Pg) boundary coincides with the Chicxulub bolide impact and also falls within the broader time frame of Deccan trap emplacement. Critically, though, empirical evidence as to how either of these factors could have driven observed extinction patterns and carbon cycle perturbations is still lacking. Here, using boron isotopes in foraminifera, we document a geologically rapid surface-ocean pH drop following the Chicxulub impact, supporting impact-induced ocean acidification as a mechanism for ecological collapse in the marine realm. Subsequently, surface water pH rebounded sharply with the extinction of marine calcifiers and the associated imbalance in the global carbon cycle. Our reconstructed water-column pH gradients, combined with Earth system modeling, indicate that a partial ∼50% reduction in global marine primary productivity is sufficient to explain observed marine carbon isotope patterns at the K-Pg, due to the underlying action of the solubility pump. While primary productivity recovered within a few tens of thousands of years, inefficiency in carbon export to the deep sea lasted much longer. This phased recovery scenario reconciles competing hypotheses previously put forward to explain the K-Pg carbon isotope records, and explains both spatially variable patterns of change in marine productivity across the event and a lack of extinction at the deep sea floor. In sum, we provide insights into the drivers of the last mass extinction, the recovery of marine carbon cycling in a postextinction world, and the way in which marine life imprints its isotopic signal onto the geological record.