The ability of stony corals to thrive in the oligotrophic (low-nutrient, low-productivity) surface waters of the tropical ocean is commonly attributed to their symbiotic relationship with photosynthetic dinoflagellates1,2. The evolutionary history of this symbiosis might clarify its organismal and environmental roles3, but its prevalence through time, and across taxa, morphologies and oceanic settings, is currently unclear4-6. Here we report measurements of the nitrogen isotope (15N/14N) ratio of coral-bound organic matter (CB-δ15N) in samples from Mid-Devonian reefs (Givetian, around 385 million years ago), which represent a constraint on the evolution of coral photosymbiosis. Colonial tabulate and fasciculate (dendroid) rugose corals have low CB-δ15N values (2.51 ± 0.97‰) in comparison with co-occurring solitary and (pseudo)colonial (cerioidor phaceloid) rugose corals (5.52 ± 1.63‰). The average of the isotopic difference per deposit (3.01 ± 0.58‰) is statistically indistinguishable from that observed between modern symbiont-barren and symbiont-bearing corals (3.38 ± 1.05‰). On the basis of this evidence, we infer that Mid-Devonian tabulate and some fasciculate (dendroid) rugose corals hosted active photosymbionts, while solitary and some (pseudo)colonial (cerioidor phaceloid) rugose corals did not. The low CB-δ15N values of the Devonian tabulate and fasciculate rugose corals relative to the modern range suggest that Mid-Devonian reefs formed in biogeochemical regimes analogous to the modern oligotrophic subtropical gyres. Widespread oligotrophy during the Devonian may have promoted coral photosymbiosis, the occurrence of which may explain why Devonian reefs were the most productive reef ecosystems of the Phanerozoic.