A system for locating earth fault in a multi-phase power grid powered by a power source, the system comprising: an alternating voltage source synchronized with the power grid and which is connected between a zero point of the power grid and earth, and a control unit configured to control the alternating voltage source in a fault current compensation mode to compensate for any ground fault current in the power network to a value below a threshold level, the system comprises at least one detector (351, 352, 35N, 361, 362, 36N) arranged in the power grid and communicatively connected to the control unit, which at least one detector (351, 352, 35N, 361, 362, 36N) is configured to register measurement values representing zero-sequence current and zero-sequence admittance, the control unit, when in a fault detection mode, is configured to gradually adjust a voltage from the alternating voltage source with respect to amplitude and/or phase angle so that a change of zero-sequence current and zero-sequence admittance between the alternating voltage source and a localization point can be measured by the at least one detector (351, 352, 35N, 361, 362, 36N), the at least one detector (351, 352, 35N, 361, 362, 36N) is configured to apply registered measured values representing zero-sequence current and/or zero-sequence admittance to the control unit, and the control unit, in the fault detection mode is configured to localize a ground fault based on at least one of said measurement values representing changes of zero-sequence current and/or zero-sequence admittance, wherein the control unit 370 is characterised in that it is configured to switch to the fault compensation mode after the fault detection mode. an alternating voltage source synchronized with the power grid and which is connected between a zero point of the power grid and earth, and a control unit configured to control the alternating voltage source in a fault current compensation mode to compensate for any ground fault current in the power network to a value below a threshold level, the system comprises at least one detector (351, 352, 35N, 361, 362, 36N) arranged in the power grid and communicatively connected to the control unit, which at least one detector (351, 352, 35N, 361, 362, 36N) is configured to register measurement values representing zero-sequence current and zero-sequence admittance, the control unit, when in a fault detection mode, is configured to gradually adjust a voltage from the alternating voltage source with respect to amplitude and/or phase angle so that a change of zero-sequence current and zero-sequence admittance between the alternating voltage source and a localization point can be measured by the at least one detector (351, 352, 35N, 361, 362, 36N), the at least one detector (351, 352, 35N, 361, 362, 36N) is configured to apply registered measured values representing zero-sequence current and/or zero-sequence admittance to the control unit, and the control unit, in the fault detection mode is configured to localize a ground fault based on at least one of said measurement values representing changes of zero-sequence current and/or zero-sequence admittance, wherein the control unit 370 is characterised in that it is configured to switch to the fault compensation mode after the fault detection mode.