Efficient utilization of power networks under extreme voltage sags and swells and reducing the losses are widely recognized as the most important issues in energy industry. Power electronic converter based flexible AC transmission system (FACTS) devices play a significant role in power flow control, power quality improvement, voltage regulation and efficient energy utilization. Distribution static synchronous series compensator (D-STATCOM) is a FACTS device and it compensates for voltage sags and swells by injecting or absorbing reactive power to/from the power network. Modulation of D-STATCOMs is mostly based on pulse width modulation (PWM) techniques and space vector PWM (SV-PWM) is attracting considerable interest due to its better DC utilization and wide linear modulation range. In this paper, a three-level SV-PWM is suggested for the modulation of D-STATCOM which is based on a three-phase diode-clamped inverter (DCI). A grid connected three-phase power system feeding a 1 MW and 500 kvar load is designed in simulation environment and D-STATCOM is tested under voltage sags and swells occurring on the generation side. Results demonstrate that D-STATCOM successfully injects/absorbs reactive power to/from the system under fluctuating grid conditions