A solar-PV system is generally connected to distributed generation (DG) by the utility grid. The solar inverter retains some capacity after active power generation. Reactive power compensation can be achieved by utilizing the remaining capacity of the solar-PV inverter. This paper introduces an energy management system (EMS) for real and reactive power management. The proposed EMS includes two modes: PV-STATCOM and islanding. In PV-STATCOM mode, the PI control is used whereas for the islanding mode, voltage frequency control is employed. This paper proposes the energy management of reactive power by utilizing the solar photovoltaic (PV) inverter as a static synchronous compensator (PV-STATCOM). Therefore, no other additional flexible AC transmission system controllers or series/shunt capacitors are required. During the islanding mode, the storage provides continuous supply to the load. The system is simulated using single-phase and three-phase modes with the hardware results also revealed. The proposed scheme provides a significant improvement in power factor while reducing the total harmonic distortion.