This document presents a control scheme for a D-STATCOM (distribution static compensator) to compensate for power factor and harmonic current in an electric power distribution system. It begins by introducing D-STATCOM technology and its role in providing reactive power support and voltage regulation on distribution feeders. It then describes the proposed control scheme, which is based on instantaneous power theory and aims to make the source current purely sinusoidal with unity power factor. Simulation results are presented comparing the proposed control scheme to an existing one, showing the new scheme achieves unity power factor compensation after a load is switched on.