Proton exchange membrane fuel cell (PEMFC), due to its high efficiency and good stability, is one of the most efficient and effective sources of alternative renewable energy. The LCL filters are utilized to attenuate the harmonics caused by inverter‐based distributed power generation systems (DPGS). In this paper, a systematic robust control design is presented for an LCL‐type grid‐tied PEMFC inverter. The proposed nested control includes the capacitor current feedback and the outer grid current loops, considering the computational delays. The proposed control results in more accurate and realistic modeling to transfer the power of PEMFC and inject a high‐quality current into a weak and harmonics‐polluted network. Also, by utilizing the proposed method, the computational delays that affect the damping capability are eliminated, and the performance of the control system is improved. In addition, designing a virtual series and parallel impedances strengthens the phase and amplitude of the inverter output impedance. As a result, the robust operation of the inverter for significant changes in network impedance is improved, and the system well attenuates the mains voltage harmonics. The simulation results in Matlab/Simulink environment confirm the performance of the control system and the suitable quality of the injected current of the PEMFC system into the weak and harmonic‐polluted network.