  Ultra-hot Jupiters have dayside temperatures at which most molecules are
expected to thermally dissociate. The dissociation of water vapour results in
the production of the hydroxyl radical (OH). While OH absorption is easily
observed in near-infrared spectra of M dwarfs, which have similar effective
temperatures as ultra-hot Jupiters, it is often not considered when studying
the atmospheres of ultra-hot Jupiters. We use high-resolution spectroscopic
observations of a transit of WASP-76b obtained using CARMENES to study the
presence of OH. After validating the OH line list, we generate model transit
spectra of WASP-76b with petitRADTRANS. The data are corrected for stellar and
telluric contamination and cross-correlated with the model spectra. After
combining all cross-correlation functions from the transit, a detection map is
constructed. Constraints on the planet properties from the OH absorption are
obtained from a Markov chain Monte Carlo analysis. OH is detected in the
atmosphere of WASP-76b with a peak signal-to-noise ratio of 6.1. From the
retrieval we obtain $K_p=232 \pm 12$ km/s and a blueshift of $-13.2 \pm 1.6$
km/s, which are offset from the expected velocities. Considering the fast spin
rotation of the planet, the blueshift is best explained with the signal
predominantly originating from the evening terminator and the presence of a
strong dayside-to-nightside wind. The increased $K_p$ over its expected value
(196.5 km/s) is, however, a bit puzzling. The signal is found to be broad, with
a full width at half maximum of $16.8^{+4.6}_{-4.0}$ km/s. The retrieval
results in a weak constraint on the mean temperature of 2700-3700 K at the
pressure range of the OH signal. We show that OH is readily observable in the
transit spectra of ultra-hot Jupiters. Studying this molecule can provide
insights into the molecular dissociation processes in the atmospheres of such
planets.
