The present disclosure relates to a method of compensating for a DC offset of a high-voltage AC output from a Modular Multilevel Converter (MMC) comprising at least one phase leg. The MMC is connected to a three-phase high-voltage AC grid via a grid transformer. The method comprises, in at least one DC offset correcting device (10), measuring the DC offset by in each of the at least one DC offset correcting device: obtaining a high-voltage AC signal in the MMC,removing high-voltage AC components from the obtained high-voltage AC signal by means of a passive higher-order filter (11) to obtained an analogue filtered signal,converting the analogue filtered signal to a digital signal by means of an analogue-to-digital converter,removing remaining AC components from the digital signal by means of a digital filter (12) to obtain the DC offset, and in a controller (13) comparing the obtained offset with a reference value and forming a control signal based on said comparing. The method also comprises transmitting the control signal from each of the at least one DC offset correcting device to a control device (20) of the MMC. The method also comprises, the control device mapping the control signal(s) from the at least one DC offset correcting device to the at least one phase leg. The method also comprising, based on the mapping, the control device sending switching commands to the semiconductor switches of MMC cells in each of the at least one phase leg to compensate for the DC offset.