Seagrasses evolved from terrestrial plants into marine foundation species around 100 million years ago. Their ecological success, however, remains a mystery because natural organic matter accumulation within the beds should result in toxic sediment sulfide levels. Using a meta-analysis, a field study, and a laboratory experiment, we reveal how an ancient three-stage symbiosis between seagrass, lucinid bivalves, and their sulfide-oxidizing gill bacteria reduces sulfide stress for seagrasses. We found that the bivalve–sulfide-oxidizer symbiosis reduced sulfide levels and enhanced seagrass production as measured in biomass. In turn, the bivalves and their endosymbionts profit from organic matter accumulation and radial oxygen release from the seagrass roots. These findings elucidate the long-term success of seagrasses in warm waters and offer new prospects for seagrass ecosystem conservation.