By using a Reynolds-averaged two-dimensional computation of a turbulent flow over an airfoil at post-stall angles of attack, we show that the massively separated and disordered unsteady flow can be effectively controlled by periodic blowing-suction near the leading edge with low-level power input. This unsteady forcing can modulate the evolution of the separated shear layer to promote the formation of concentrated lifting vortices, which in turn interact with trailing-edge vortices in a favourable manner and thereby alter the global deep-stall flow field. In a certain range of poststall angles of attack and forcing frequencies, the unforced random separated flow can become periodic or quasi-periodic, associated with a significant lift enhancement. This opens a promising possibility for flight beyond the static stall to a much higher angle of attack. The same local control also leads, in some situations, to a reduction of drag. On a part of the airfoil the pressure fluctuation is suppressed as well, which would be beneficial for high-α buffet control. The computations are in qualitative agreement with several recent post-stall flow control experiments. The physical mechanisms responsible for post-stall flow control, as observed from the numerical data, are explored in terms of nonlinear mode competition and resonance, as well as vortex dynamics. The leading-edge shear layer and vortex shedding from the trailing edge are two basic constituents of unsteady post-stall flow and its control. Since the former has a rich spectrum of response to various disturbances, in a quite wide range the natural frequency of both constituents can shift and lock-in to the forcing frequency or its harmonics. Thus, most of the separated flow becomes resonant, associated with much more organized flow patterns. During this nonlinear process the coalescence of small vortices from the disturbed leading-edge shear layer is enhanced, causing a stronger entrainment and hence a stronger lifting vortex. Meanwhile, the unfavourable trailing-edge vortex is pushed downstream. The wake pattern also has a corresponding change: the shed vortices of alternate signs tend to be aligned, forming a train of close vortex couples with stronger downwash, rather than a Kármán street.