Background and Objectives: In this paper, a novel approach for regulation of the output current in the grid-connected three-level flying capacitor inverter is presented by using the sliding mode (SM) method. In the proposed method, it is possible to control the active and reactive components of the inverter output current independently, and therefore it can be employed for grid connection of the renewable energy resources or for harmonic and reactive power compensation of the local loads. The designed controller uses an external loop to control the voltage of the inverter DC link and has a constant switching frequency. The stability of the proposed method has also been proved by using the Lyapunov stability theory. The simulation results show that in different operating conditions, the proposed controller has a stable and robust response. Methods: Grid-connected three-level flying capacitor inverter is modeled by using averaged state space technique. Considering nonlinearity of the obtained model, an equivalent SM controller is developed for output current control of the multilevel grid connected inverter. To improve robustness and stability of the system against uncertainty of model parameters, a nonlinear component is added to the equivalent controller. Results: The proposed controller enjoys very fast dynamic response, so it can be employed in wide ranges of application e. g. reactive compensation and harmonic mitigation modes. In active power filtering operation, it is able to eliminate harmonic components of the grid from 20. 61% to 1. 34% which is compatible with IEEE and IEC standards. Conclusion: The stability of the proposed method has also been proved by using the Lyapunov stability theory. The simulation results show that in different operating conditions, the proposed controller has a stable and robust response.