The oxygen molecule was found in a gas cloud called rho Oph A in the Ophiuchus constellation, about 500 light years from Earth.
The element's abundance is 1,000 times lower than can be explained by today's chemical models, according to the research team, which includes Canadian astronomers and scientists from Sweden, France and Finland.
Molecules are structures composed of atoms.
Two atoms of the element oxygen form an oxygen molecule.
A light year is the distance light travels in a year, or about 9.461 trillion kilometres.
Their discovery and findings — made with the Swedish Odin space observatory satellite developed collaboratively by the countries and launched in 2001 to find the oxygen — are reported in the scientific journal Astronomy and Astrophysics.