The primary objective of this paper focuses on developing a control approach to improve the operational performance of a three-level neutral point clamped (3LNPC) shunt active power filter (SAPF) within a grid-tied PV system configuration. Indeed, this developed control approach, based on the used 3LNPC-SAPF topology, aims to ensure the seamless integration of a photovoltaic system into the three-phase four-wire grid while effectively mitigating grid harmonics, grid current unbalance, ensuring grid unit power factor by compensating the load reactive power, and allowing power sharing with the grid in case of an excess of generated power from the PV system, leading to overall high power quality at the grid side. This developed approach is based initially on the application of the four-wire instantaneous p-q theory for the identification of the reference currents that have to be injected by the 3LNPC-SAPF in the grid point of common coupling (PCC). Whereas, the 3LNPC is controlled based on using the finite control set model predictive control (FCS-MPC), which can be accomplished by determining the convenient set of switch states leading to the voltage vector, which is the most suitable to ensure the minimization of the selected cost function. Furthermore, the used topology requires a constant DC-link voltage and balanced split-capacitor voltages at the input side of the 3LNPN. Hence, the cost function is adjusted by the addition of another term with a selected weighting factor related to these voltages to ensure their precise control following the required reference values. However, due to the random changes in solar irradiance and, furthermore, to ensure efficient operation of the proposed topology, the PV system is connected to the 3LNPN-SAPF via a DC/DC boost converter to ensure the stability of the 3LNPN input voltage within the reference value, which is achieved in this paper based on the use of the maximum power point tracking (MPPT) technique. For the validation of the proposed control technique and the functionality of the used topology, a set of simulations has been presented and investigated in this paper following different irradiance profile scenarios such as a constant irradiance profile and a variables irradiance profile where the main aim is to prove the effectiveness and flexibility of the proposed approach under variable irradiance conditions. The obtained results based on the simulations carried out in this study demonstrate that the proposed control approach with the used topology under different loads such as linear, non-linear, and unbalanced can effectively reduce the harmonics, eliminating the unbalance in the currents and compensating for the reactive component contained in the grid side. The obtained results prove also that the proposed control ensures a consistent flow of power based on the sharing principle between the grid and the PV system as well as enabling the efficient satisfaction of the load demand. It can be said that the proposal presented in this paper has been proven to have many dominant features such as the ability to accurately estimate the power sharing between the grid and the PV system for ensuring the harmonics elimination, the reactive power compensation, and the elimination of the neutral current based on the zero-sequence component compensation, even under variable irradiance conditions. This feature makes the used topology and the developed control a valuable tool for power quality improvement and grid stability enhancement with low cost and under clean energy. [ABSTRACT FROM AUTHOR]