This paper presents the approach for an automatic control strategy for spin avoidance and/or recovery. The recovery is based on an optimal control algorithm developed specifically for this task. A new model for the aircraft aerodynamics is used to calculate the statedependent aerodynamic forces and moments. Controldependent forces and moments to avoid spin entry and to recover from a fully developed spin state are computed using an optimal control algorithm. For practical application of this algorithm, control surface deflections are computed using the same aircraft model. The algorithm is shown to successfully recover a light aircraft from partially and fully developed spins in a simulation, in much the same manner an experienced test pilot does.