In this work, an integrated system that combines anodizing process with the deposition of a hybrid SiO 2 sol-gel coating was developed with the aim of improving the corrosion resistance of AZ31B Mg alloy. The optimization of the anodizing conditions using an alkaline electrolyte (NaOH) modified with different concentrations of sodium metasilicate pentahydrate were explored together with the preparation and deposition of a SiO 2 sol obtained by hydrolysis and condensation of TEOS (tetraethoxysilane), GPTMS (3-Glycidyloxypropyl) trimethoxysilane), colloidal SiO 2 nanoparticles, and 1-Methylimidazole (MI). The surface morphology, coating thickness and composition were evaluated. The anodized coatings thickness was between 1.1 and 1.7 µm with composition corresponding to magnesium oxide and low silicon content. The corrosion performance was tested in 3.5% NaCl solution. The results revealed a good corrosion resistance behaviour after the anodizing of the Mg alloys. However, the best corrosion resistance was reached when the porous PEO layer was sealed with a hybrid silica sol-gel film. A decrease in the corrosion current density of three orders of magnitude is observed between Mg alloy (1.54E-06 A/cm 2 ) and multilayer system (2.80E-8 A/cm 2 ). Moreover, the polarization resistance for 8AF+SG samples showed a quite high value (31546.8 Ω cm 2 ) compared to Mg alloy (207.3 Ω cm 2 ).