The global degradation of coral reefs is steadily increasing with ongoing climate change. Yet coral larvae settlement, a key mechanism of coral population rejuvenation and recovery, is largely understudied. Here, we show how the lipophilic, settlement-inducing bacterial pigment cycloprodigiosin (CYPRO) is actively harvested and subsequently enriched along the ectoderm of larvae of the scleractinian coral Leptastrea purpura. A light-dependent reaction transforms the CYPRO molecules through photolytic decomposition and provides a constant supply of hydrogen peroxide (H2O2), leading to attachment on the substrate and metamorphosis into a coral recruit. Micromolar concentrations of H2O2 in seawater also resulted in rapid metamorphosis, but without prior larval attachment. We propose that the morphogen CYPRO is responsible for initiating attachment while simultaneously acting as a molecular generator for the comprehensive metamorphosis of pelagic larvae. Ultimately, our approach opens a novel mechanistic dimension to the study of chemical signaling in coral settlement and provides unprecedented insights into the role of infochemicals in cross-kingdom interactions.