SiO2 sol sealing agent was developed by hydrolyzing of organic alkoxide, and protective composite coatings were obtained on magnesium alloys AZ31B by micro-arc oxidation (MAO) treatment plus a top coating with sealing agent using dipping-costing technique. SEM observations revealed that SiO2 sol immersed into pores and uniformly covered the surface of MAO coating. XPS analysis indicated that an inorganic SiO2 layer has formed on the surface of MAO coating. The results of potentiodynamic polarization tests showed that corrosion resistance of AZ31B alloys with composite coatings was evidently superior to that of merely MAO coating. The SiO2 layer provided corrosion protection by physically sealing the pores on the MAO coating and acting as a barrier. The composite coatings could suppress the corrosion process by preventing the transferring or diffusing of corrosive ions between magnesium alloys substrate and solution.