Trophic cascade theory predicts that predator effects should extend to influence carbon cycling in ecosystems. Yet, there has been little empirical evidence in natural ecosystems to support this hypothesis. Here, we use a naturally-occurring trophic cascade to provide evidence that predators help protect sedimentary organic carbon stocks in coral reef ecosystems. Our results show that predation risk altered the behavior of herbivorous fish, whereby it constrained grazing to areas close to the refuge of the patch reefs. Macroalgae growing in "riskier" areas further away from the reef were released from grazing pressure, which subsequently promoted carbon accumulation in the sediments underlying the macroalgal beds. Here we found that carbon stocks furthest away from the reef edge were ~24% higher than stocks closest to the reef. Our results indicate that predators and herbivores play an important role in structuring carbon dynamics in a natural marine ecosystem, highlighting the need to conserve natural predator-prey dynamics to help maintain the crucial role of marine sediments in sequestering carbon.