This paper proposes a control method for grid-connected inverter under unbalanced and distorted grid voltage. The proposed method can reduce the power ripple caused by the unbalanced grid voltage and compensate for the low-order harmonics such as 3rd, 5th, 7th of the output currents caused by the distortion of grid voltage. Proposed method replaces the four conventional PI controllers with two PR controllers in the stationary frame to reduce the power ripple. PR controller which have high gain at the specific frequency band can implement selective harmonic compensation without much computational requirements; the use of these controllers simplifies the method. Both the simulated and experimental results agree well with the theoretical analysis.