This paper addresses the problem of controlling the single-phase grid connected to the photovoltaic (PV) system through a three-level boost converter (TLBC) and half-bridge inverter (HBI) with LCL-filter. This study aims to achieve four main objectives: (i) ensure that the output voltage of PV panel track a reference given by the MPPT block based on the perturb and observe (P&O) algorithm; (ii) regulate DC bus voltage to ensure injection of photovoltaic power into the grid; (iii) guarantee power factor correction (PFC); (iv) ensure a balance between TLBC output voltages. The problem is dealt with using a nonlinear controller based on the backstepping and lyapunov approaches, a filtered-PI regulator to ensure the power balance between the grid and the PV panel. An adaptive observer is designed in order to estimate the voltage and the impedance parameters of power grid, by measuring only the grid current. The proposed controller and observer performances are confirmed by simulation in MATLAB\\Simulink.