This paper presents a harmonic compensation strategy for a 3-ϕ grid-tied solar energy conversion system with leakage current attenuation feature. As parasitic capacitance exists between the solar photovoltaic panels with the ground, the deviation in common-mode voltage compels the probable safety hazards such as electromagnetic interference and harmonics injection in the grid currents. Additionally, the power quality indices of the grid, are exacerbated with the coupling of the non-linear load. Owing to these issues, a generalized integrator based approach is introduced to ensure the harmonics suppression, power factor correction, leakage current alleviation. Additionally, the grid current distortion limits are ensured within limits in order to comply with the IEEE std. 519. The presented algorithm ensures a robust operation with respect to various anomalies in the grid voltages. Simulation results show the satisfactory response of the harmonics controller even under abnormal operating scenarios including the symmetrical/unsymmetrical faults in the grid side network. In comparison with the traditional algorithms, the harmonic controller suppresses the leakage current and harmonics within restricted limits despite the abnormal conditions. Real-time simulator results demonstrate the performance of the controller under distinct operating conditions such as load unbalancing, distorted grid voltages, etc.This is an open access article under the terms of the Creative Commons Attribution License, which permits use, distribution and reproduction in any medium, provided the original work is properly cited.