In three-phase distribution networks non-linear loads can give rise to DC current components. A DC current component is particularly detrimental for the distribution power transformers, because it can lead to asymmetric magnetic core saturation. Apart from an increased THD in line currents, transformers operating under saturation conditions present increased VAR absorption, and, accordingly, possible damage consequent to the overheating. This paper proposes an electronic system able to compensate the undesired DC current components flowing in a three-phase distribution grid. This system comprehends a precise magnetic sensor and a power converter stage (different for low or medium-high voltage grids). The magnetic sensor detects the effects of the DC current components that flow in the power conductors, whereas the power converter compensates them. Simulation and experimental results show the effectiveness of the proposed system.