Nowadays, integration of intermittent and distributed renewable energy generations into power grid causes to have power quality problems as concern. These problems are usually causing very costly consequences such as production line and/or sensitive load interruption. Hence, it is crucial to have stable voltage with good quality. One of the most effective power-electronics-based approach to alleviate the mentioned problems is dynamic voltage restorer (DVR). DVR is capable to restore the voltage at load side whenever grid voltage is disturbed. This paper presents a DVR structure for medium-voltage power grid based on double flying capacitor multicell inverter. In the proposed DVR circuit, an energy storage connected to the dc link of the inverter provides the needed active power to restore the voltage quality. In order to minimize the required energy from energy storage, the energy optimized strategy is implemented to compensate the voltage sag. Furthermore, d-q synchronous reference frame-based method is implemented to calculate the DVR reference voltages. To validate the operation of the presented DVR circuit, simulation results are provided for different cases.