The correction efficiency of adaptive optics is limited mainly by measurement noise and time delay. To overcome this problem, we describe a new modal linear predictive controller whose parameters are optimized by means of a recursive least-squares algorithm to minimize the residual optical phase variance. The method copes with the recursivity of the closed-loop operation. We demonstrate that the optimal rejection transfer function for adaptive optics is proportional to the frequency signal-to-noise ratio. Finally, we present what we believe to be the first experimental results obtained with a predictor used to control the tip-tilt mirror of an adaptive-optics system.