The optimal control of a globally unstable two-dimensional separated boundary layer over a bump is considered using augmented Lagrangian optimization procedures. The present strategy allows of controlling the flow from a fully developed nonlinear state back to the steady state using a single actuator. The method makes use of a decomposition between the slow dynamics associated with the baseflow modification, and the fast dynamics characterized by a large scale oscillation of the recirculation region, known as flapping. Starting from a steady state forced by a suction actuator located near the separation point, the baseflow modification is shown to be controlled by a vanishing suction strategy. For weakly unstable flow regimes, this control law can be further optimized by means of direct-adjoint iterations of the nonlinear Navier-Stokes equations. In the absence of external noise, this novel approach proves to be capable of controlling the transient dynamics and the baseflow modification simultaneously.