  In this paper we prove that the Benjamin-Ono equation, when considered on the
torus, is an integrable (pseudo)differential equation in the strongest possible
sense: it admits global Birkhoff coordinates on the space $L^2(\T)$. These are
coordinates which allow to integrate it by quadrature and hence are also
referred to as nonlinear Fourier coefficients. As a consequence, all the
$L^2(\T)$ solutions of the Benjamin--Ono equation are almost periodic functions
of the time variable. The construction of such coordinates relies on the
spectral study of the Lax operator in the Lax pair formulation of the
Benjamin--Ono equation and on the use of a generating functional, which encodes
the entire Benjamin--Ono hierarchy.
