Abstract: The increasing integration of inverter-based renewable energy sources has considerably changed the behaviourofmodern power systems, especially in weak grid and low-inertia operating conditions. Conventional grid-following invertersmainlydepend on phase-locked loop (PLL) synchronisation and require the support of a strong utility grid for proper operation. Duetothis dependency, their performance becomes limited during grid outage or islanding conditions. On the other hand, grid-forminginverters can independently establish and regulate system voltage and frequency, making them more suitable for stableislandedoperation when combined with battery energy storage systems (BESS). This paper presents a comparative study of grid-formingand grid-following control techniques for a solar photovoltaic (PV) system integrated with battery energy storage undergridoutage conditions. To ensure a fair comparison, both control strategies were implemented using the same systemconfigurationand operating conditions in MATLAB/Simulink. The study mainly evaluates the performance of both approaches intermsofvoltage and frequency regulation, active and reactive power response, and harmonic characteristics during the transitionfromgrid-connected mode to islanded operation. Simulation results show that the grid-following inverter loses synchronisationandexperiences deterioration in power quality after grid disconnection. In contrast, the grid-forming inverter successfully maintainsstable voltage and frequency, enabling smooth and uninterrupted islanded operation. Additionally, the grid-formingapproachachieves lower voltage and current total harmonic distortion (THD) compared to the grid-following method. Keywords: Grid-Forming Inverter, Grid-Following Inverter, Battery Energy Storage System (BESS), Solar PhotovoltaicSystem,Harmonic Distortion, Power Quality