  The number of magnetic stars detected among massive stars is small;
nevertheless, the role played by the magnetic field in stellar evolution cannot
be disregarded. Links between line profile variability, enhancements/depletions
of surface chemical abundances, and magnetic fields have been identified for
low-mass B-stars, but for the O-type domain this is almost unexplored. Based on
FORS2 and HARPS spectropolarimetric data, we present the first detection of a
magnetic field in HD54879, a single slowly rotating O9.7 V star. Using two
independent and different techniques we obtained the firm detection of a
surface average longitudinal magnetic field with a maximum amplitude of about
600 G, in modulus. A quantitative spectroscopic analysis of the star with the
stellar atmosphere code FASTWIND results in an effective temperature and a
surface gravity of 33000$\pm1000$ K and 4.0$\pm0.1$ dex. The abundances of
carbon, nitrogen, oxygen, silicon, and magnesium are found to be slightly lower
than solar, but compatible within the errors. We investigate line-profile
variability in HD54879 by complementing our spectra with spectroscopic data
from other recent OB-star surveys. The photospheric lines remain constant in
shape between 2009 and 2014, although H$\alpha$ shows a variable emission. The
H$\alpha$ emission is too strong for a standard O9.7 V and is probably linked
to the magnetic field and the presence of circumstellar material. Its normal
chemical composition and the absence of photospheric line profile variations
make HD54879 the most strongly magnetic, non-variable single O-star detected to
date.
