This paper presents the design and implementation of a resonant controller into a PI-P control configuration (PI-P+Resonant controller). The idea PI-P control is avoid that large control signals causing the saturation phenomena in the system. On the other hand, the resonant controller allows providing high gain at the frequency of the harmonics, in order to mitigate these harmonics. Consequently, the combination of the two controllers (PI-P+Resonant controller) turns out to be an adequate solution to reduce total harmonic distortion in the output voltage (THD <sub xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">v</sub> ) of a single-phase inverter due to nonlinear loads. The design of this controller is conducted for inverter operation in island mode within the context of microgrids. That is, in this mode, the inverter must supply the load independently. The controller implemented should be able to regulate the output voltage to be supplied to the load while maintaining the waveform, frequency and amplitude of the output signal.