Peroxygenases offer an attractive means to address challenges in selective oxyfunctionalization chemistry. Despite this, their application in synthetic chemistry remains challenging due to their facile inactivation by the stoichiometric oxidant H2O2. Often atom-inefficient peroxide generation systems are required, which show little potential for large-scale implementation. Here, we show that visible-light-driven, catalytic water oxidation can be used for in situ generation of H2O2 from water, rendering the peroxygenase catalytically active. In this way, the stereoselective oxyfunctionalization of hydrocarbons can be achieved by simply using the catalytic system, water and visible light.