Ceramic coatings were produced on magnesium (Mg) alloy of AZ91D for biomaterial applications by micro-arc oxidation (MAO) and electrodeposition methods. The morphology, microstructure, phase composition and corrosion properties of the prepared coatings were investigated by scanning electron microscopy (SEM), X-ray diffraction (XRD) and potentiodynamic polarization tester, etc. The results indicated that a porous oxide layer was grown on the Mg alloy sheets after MAO process and the compositions of oxides were mainly Mg2SiO4 and MgO. After further electrodeposition and alkaline treatment, a flake-like structure diverging from centre to periphery was grown on the MAO coating and the coating was mainly made up of hydroxyapatite (HA). Moreover, the corrosion resistance of the Mg alloy after being treated with MAO and electrodeposition technique increases obviously, which was evaluated in stimulated body fluid (SBF).