Molecular oxygen, O
2
, is vital to life on Earth and possibly also on exoplanets. Although the biogenic processes leading to its accumulation in Earth’s atmosphere are well understood, its abiotic origin is still not fully established. Here, we report combined experimental and theoretical evidence for electronic state–selective production of O
2
from SO
2
, a chemical constituent of many planetary atmospheres and one that played an important part on Earth in the Great Oxidation Event. The O
2
production involves dissociative double ionization of SO
2
leading to efficient formation of the
O
2
+
ion, which can be converted to abiotic O
2
by electron neutralization or by charge exchange. This formation process may contribute substantially to the abundance of O
2
and related ions in planetary atmospheres, such as the Jovian moons Io, Europa, and Ganymede. We suggest that this sort of ionic pathway for the formation of abiotic O
2
involving multiply charged molecular ion decomposition may also exist for other atmospheric and planetary molecules.