  We prove that the error term $\La(R)$ in the Weyl asymptotic formula $$\#\{
E_n\le R^2\}={\Vol M\over 4\pi} R^2+\La(R),$$ for the Laplace operator on a
surface of revolution $M$ satisfying a twist hypothesis, has the form $\La(R)
=R^{1/2}F(R)$ where $F(R)$ is an almost periodic function of the Besicovitch
class $B^2$, and the Fourier series of $F(R)$ in $B^2$ is $\sum_\g
A(\g)\cos(|\g|R-\phi)$ where the sum goes over all closed geodesics on $M$, and
$A(\g)$ is computed through simple geometric characteristics of $\g$. We extend
this result to surfaces of revolution, which violate the twist hypothesis and
satisfy a more general Diophantine hypothesis. In this case we prove that
$\La(R)=R^{2/3}\Phi(R)+R^{1/2}F(R)$, where $\Phi(R)$ is a finite sum of
periodic functions and $F(R)$ is an almost periodic function of the Besicovitch
class $B^2$. The Fourier series of $\Phi(R)$ and $F(R)$ are computed.
