The problems of grid impedance fluctuations and harmonic interference exist widely in grid-connected inverter systems in a weak grid. A robust H∞ control strategy based on linear matrix inequalities (LMIs) is proposed to solve these problems. The proposed strategy improves the adaptation of inverters to a weak grid and the quality of the grid output current. First, an LCL-type grid-connected inverter model with a resonant controller is established. A reduced-order generalized integratorensures zero-error tracking of grid current and grid harmonics suppression in the resonant controller. The inverter model, delayed session and resonant controller model are integrated into a polytopic model that describes an uncertain system. Then, a robust H∞ controller is designed to control the integrated polytopic uncertainty model based on LMIs. A suitable optimization condition is designed for the controller gain to avoid violent oscillations of the system. Finally, a hardware-in-the-loop experiment is performed to validate the effectiveness of the suggested approach.