Composite coating was prepared on AZ91D magnesium alloy with a new method which combined silica sol with micro-arc oxidation (MAO). The MAO coating was prepared on the basis of MAO solution, and then coated by sol–gel process. The composite coating was obtained after second MAO treatment. Scanning electron microscopy coupled with X-ray diffraction (XRD), energy spectrum analysis and electrochemical testing was applied to characterize the properties of MAO coating and composite coating. The experimental test results indicated that the Si element derived from SiO2 gel particle embedded into the MAO coating by second MAO treatment. The surface of composite coating became dense and the holes were smaller with silica sol sealing process. The corrosion resistance of composite coating was improved than the MAO coating.