This document proposes a flexible D-STATCOM (FD-STATCOM) system that can both mitigate power quality issues caused by faults like line-to-line and double line-to-ground faults, and act as a distributed generator by supplying power to sensitive loads when the main utility source is disconnected. It describes the FD-STATCOM's ability to mitigate voltage sags under different fault conditions and while in islanding mode. The paper also presents a new control method for the FD-STATCOM to mitigate voltage sags caused by faults and islanding.