The problem of controlling single-phase shunt active power filter is addressed in presence of nonlinear loads. The control objective is twofold: (i) compensation of harmonic and reactive currents absorbed by the nonlinear load; (ii) regulation of the inverter output capacitor voltage. A two-loop cascade control strategy is developed that includes an inner-loop designed, using the backstepping technique, to cope with the compensation issue and an outer-loop designed to regulate the capacitor voltage. The controller performances are formally analysed, using the averaging theory. The analysis results are illustrated by simulation.Preprin