Oxygen (O₂) is released as a gaseous by-product during the light-dependent reactions of photosynthesis when water molecules are split (photolysis).