  We prove that the Benjamin--Ono equation on the torus is globally in time
well-posed in the Sobolev space $H^{s}(\mathbb{T},\mathbb{R})$ for any $s > -
1/2$ and ill-posed for $s \le - 1/2$. Hence the critical Sobolev exponent
$s_c=-1/2$ of the Benjamin--Ono equation is the threshold for well-posedness on
the torus. The obtained solutions are almost periodic in time. Furthermore, we
prove that the traveling wave solutions of the Benjamin-Ono equation on the
torus are orbitally stable in $H^{s}(\mathbb{T},\mathbb{R})$ for any $ s > -
1/2$. Novel conservation laws and a nonlinear Fourier transform on
$H^{s}(\mathbb{T},\mathbb{R})$ with $s > - 1/2$ are key ingredients into the
proofs of these results.
