Aiming at the problem that the existing single-phase-to-ground fault flexible compensation device has low compensation accuracy, long response time, and needs DC side power supply, a flexible compensation device based on double-loop passivity-based control is proposed. Firstly, the topology and working principle of the device are analyzed. And a compensation current distribution method of the bridge arm is proposed. Secondly, a double-loop passivity-based controller is designed. Finally, the proposed method is verified by MATLAB/Simulink software and 10 kV physical simulation system of distribution network. The comparisons between double-loop passivity-based control, passivity-based control, and proportional integration control is discussed. The result shows that the proposed method can accurately and rapidly compensate the fault current.