  Oxygen is a constituent of many of the most abundant molecules detected in
exoplanetary atmospheres and a key ingredient for tracking how and where a
planet formed. In particular, the OI 777.4 nm triplet is used to probe airglow
and aurora on the Earth and the oxygen abundance in stellar atmospheres, but
has not been detected in an exoplanet atmosphere before. We present a definite
ground-based detection of the neutral oxygen 777.4 nm triplet lines in the
transmission spectrum of the ultra-hot Jupiter KELT-9b, the hottest known giant
planet. The synthetic spectrum computed employing novel non-local thermodynamic
equilibrium (NLTE) radiative transfer calculations matches the data
significantly better compared to the one computed assuming local thermodynamic
equilibrium. These NLTE radiative transfer calculations imply a mass-loss rate
of 10^8-10^9 kg s-1, which exceeds the lower limit of 10^7-10^8 kg s-1 required
to facilitate the escape of oxygen and iron from the atmosphere. Assuming a
solar oxygen abundance, the NLTE model points towards the need of
microturbulence and macroturbulence broadening of 3.0pm0.7 km s-1 and 13pm5 km
s-1, respectively, indicative of the presence of fast winds in the middle and
upper atmosphere. Present and upcoming high-resolution spectrographs will allow
the detection in other exoplanets of the 777.4 nm OI triplet, which is a
powerful tool to constrain the key characteristics of exoplanetary atmospheres
when coupled with forward modelling accounting for NLTE effects.
