Karst systems, comprising interconnected voids and caves, are ubiquitous in carbonate formations and play a pivotal role in the global water supply. Accumulating evidence suggests that a significant portion of the global karst is hypogenic, formed via rock dissolution by groundwater ascending from depth (rather than by infiltration from the surface), yet the exact formation mechanism remains unclear. Here we show that cooling of carbon dioxide-rich geothermal fluids, which turns them into highly corrosive agents due to their retrograde solubility, can dissolve and sculpt large caves on short geological timescales. A conceptual hydro-thermo-geochemical scenario is numerically simulated, showing cave formation by rising hot water discharging into a confined layer. Our models predict field observations characteristic of hypogenic caves, including enigmatic locations of the largest passages and intricate maze-like networks. Finally, we suggest that deep-seated carbon dioxide consumption during karst formation may constitute a link to the global carbon cycle.