This paper presents a control algorithm based on enhanced phase-locked loop (EPLL) for distribution static compensator (DSTATCOM) to compensate reactive power, to provide load balancing, to eliminate harmonics, to correct power factor, and to regulate point of common coupling (PCC) voltages under linear and nonlinear loads. In this approach, an extraction of fundamental active and reactive power components of load currents for the estimation of source currents includes a signal-processing algorithm based on the EPLL scheme. The proposed control algorithm is implemented using a digital signal processor. Test results on a developed DSTATCOM are presented to validate the proposed control algorithm for compensation of reactive power, load balancing, harmonics elimination, power factor correction, and zero voltage regulation at PCC.