Nearly all the oxygen in the air was made by photosynthesis, by bacteria, algae and plants over billions of years. Every O₂ molecule they give off starts out as part of a water molecule.
Oxygen atoms go into photosynthesis in two molecules, carbon dioxide and water, and for a long time chemists thought light split carbon dioxide. In the 1930s Cornelis van Niel studied purple bacteria that photosynthesise with hydrogen sulfide, H₂S, in place of water, and make sulfur in place of oxygen. He suggested that plants split water in the same way.
Labelling the oxygen
In 1941, at the University of California, Berkeley, Samuel Ruben and Martin Kamen, with Merle Randall and J. L. Hyde, tested the idea with a heavy kind of oxygen atom. About 1 oxygen atom in 500 is oxygen-18, with 8 protons and 10 neutrons. Ordinary oxygen has 8 of each. Oxygen-18 reacts in the same way, and its extra mass lets chemists tell it apart.
They gave Chlorella, a single-celled green alga, water with extra oxygen-18. The oxygen the algae gave off carried the same share of oxygen-18 as the water. When they put the extra oxygen-18 into the carbon dioxide, the oxygen given off matched the ordinary water.
Oxygen atoms slowly swap between carbon dioxide and water, so the labels in these first experiments had time to mix a little. Later experiments, which measured the oxygen as it was given off, confirmed the result: the oxygen comes from water.
Splitting water
A reaction centre that has lost an electron takes one back from water. A small cluster of four manganese atoms and one calcium atom, held in a protein, takes four electrons from two water molecules, one at a time, and lets go of an O₂ molecule: 2 H₂O → O₂ + 4 H⁺ + 4 electrons. The electrons go on, through the energy-carrying molecules, to turn carbon dioxide into sugar.
The 6 O₂ in the balanced equation get all their oxygen atoms from water. So the plant splits more water than the equation shows, and makes some new water along the way.