  The problem of photon creation from vacuum due to the nonstationary Casimir
effect in an ideal one-dimensional Fabry--Perot cavity with vibrating walls is
solved in the resonance case, when the frequency of vibrations is close to the
frequency of some unperturbed electromagnetic mode: $\omega_w=p(\pi
c/L_0)(1+\delta)$, $|\delta|\ll 1$, (p=1,2,...). An explicit analytical
expression for the total energy in all the modes shows an exponential growth if
$|\delta|$ is less than the dimensionless amplitude of vibrations $\epsilon\ll
1$, the increment being proportional to $p\sqrt{\epsilon^2-\delta^2}$. The rate
of photon generation from vacuum in the (j+ps)th mode goes asymptotically to a
constant value $cp^2\sin^2(\pi j/p)\sqrt{\epsilon^2-\delta^2}/[\pi L_0
(j+ps)]$, the numbers of photons in the modes with indices p,2p,3p,... being
the integrals of motion. The total number of photons in all the modes is
proportional to $p^3(\epsilon^2-\delta^2) t^2$ in the short-time and in the
long-time limits. In the case of strong detuning $|\delta|>\epsilon$ the total
energy and the total number of photons generated from vacuum oscillate with the
amplitudes decreasing as $(\epsilon/\delta)^2$ for $\epsilon\ll|\delta|$. The
special cases of p=1 and p=2 are studied in detail.
