The abrupt transfer from grid-connected (GC) to stand-alone (SA) operation modes is one of the major issues that may threaten the stability of a distributed generation (DG) system. Furthermore, if the islanding mode happens, it is vital to take into consideration the load voltages or load current waveforms as soon as feasible. This paper develops an advanced control technique based on a super-twisting sliding mode controller (ST-SMC) for a three-phase inverter operating in both the GC and SA modes. This control scheme is proposed to ensure a smooth transition from the GC to SA mode and enhance the load voltage waveforms under the islanding mode. In addition, to minimize the operational costs of the system and the complexity of the studied model, a digital Luenberger observer (DLO) with a proper design is adopted for estimating the inverter-side current. The control scheme of the whole system switches between a current control mode during the GC mode and a voltage control mode during the SA mode. The super-twisting control algorithm is applied to the outer voltage control loop involved in the cascaded voltage/current control scheme in the SA mode. Simulation tests of a three-phase inverter are performed for the purpose of assessing the suggested control performance by using the PowerSim (PSIM) software and comparing it with a classical PI controller. Furthermore, a processor-in-the-loop (PIL) implementation in a DSP board TMS32F28335 while debugging is conducted using code composer studio 6.2.0. The obtained results show efficient control properties, such as a smooth transition among the microgrid (MG) operating modes, as well as effectiveness and robustness during both the GC and SA operation modes.