It has been known for decades that the observed number of baryons in the local Universe falls about 30–40 per cent short1,2 of the total number of baryons predicted3 by Big Bang nucleosynthesis, as inferred4,5 from density fluctuations of the cosmic microwave background and seen during the first 2–3 billion years of the Universe in the so-called ‘Lyman α forest’6,7 (a dense series of intervening H i Lyman α absorption lines in the optical spectra of background quasars). A theoretical solution to this paradox locates the missing baryons in the hot and tenuous filamentary gas between galaxies, known as the warm–hot intergalactic medium. However, it is difficult to detect them there because the largest by far constituent of this gas—hydrogen—is mostly ionized and therefore almost invisible in far-ultraviolet spectra with typical signal-to-noise ratios8,9. Indeed, despite large observational efforts, only a few marginal claims of detection have been made so far2,10. Here we report observations of two absorbers of highly ionized oxygen (O vii) in the high-signal-to-noise-ratio X-ray spectrum of a quasar at a redshift higher than 0.4. These absorbers show no variability over a two-year timescale and have no associated cold absorption, making the assumption that they originate from the quasar’s intrinsic outflow or the host galaxy’s interstellar medium implausible. The O vii systems lie in regions characterized by large (four times larger than average11) galaxy overdensities and their number (down to the sensitivity threshold of our data) agrees well with numerical simulation predictions for the long-sought warm–hot intergalactic medium. We conclude that the missing baryons have been found.