A single-phase grid-connected inverter has the similar structure with the active power filter. In the single-phase grid-connected inverter system based on LCL filter, a control strategy for single-phase inverter with the function of compensating harmonic and providing reactive power is proposed. First of all, by the means of analyzing the grid-connected inverter system structure and model, a quasi-proportional resonant control method is proposed, gaining the control of grid-connected current and compensation current. And then, the calculation methods of composite control command current based on both second order generalized integrator-quadrature signal generator (SOGI-QSG) and instantaneous reactive power theory are raised. At last, the availability of this control strategy given in this paper is verified by simulation.