There is ongoing debate as to when oxygenic photosynthesis evolved on Earth1,2. Geochemical data from ancient sediments indicate localized or ephemeral photosynthetic O2 production before the Great Oxidation Event (GOE) approximately 2.5–2.3 billion years ago (Ga), and currently suggest Archaean origins, approximately 3 Ga or earlier3–9. However, sedimentary records of the early Earth often suffer from preservation issues, and poor control on the timing of oxidation leaves geochemical proxy data for the ancient presence of O2 open to critique10–13. Here, we report rare Earth element data from three different Archaean carbonate platforms preserved in greenstone belts of the northwest Superior Craton (Canada), which were deposited by the activity of marine photosynthetic bacteria 2.87 Ga, 2.85 Ga and 2.78 Ga. All three indicate O2 production before the GOE in the form of significant depletions in cerium (Ce), reflecting oxidative Ce removal from ancient seawater, as occurs today14. Using 138La-138Ce geochronology, we show that La/Ce fractionation, and thus Ce oxidation, occurred at the time of deposition, making these the oldest directly dated Ce anomalies. These results place the origin of oxygenic photosynthesis in the Mesoarchaean or earlier and bring an important new perspective on a long-standing debate regarding Earth’s biological and geochemical evolution.