By the method of microarc oxidation for different types of electrolytes (which include KOH, Na2SiO3, Н2О2, NaOH, NaAlO2, Na5P3O10, NaF) and electrolysis conditions, multifunctional ceramic coatings on a magnesium alloy were obtained. The phase composition of the coating includes magnesium oxide (MgO), spinel MgAl2O4, Mg2SiO4 and Мg3(РО4)2 compounds. The phase composition of the coatings is determined by the composition of the electrolyte. The obtained MAO coatings provide high hardness, which is 1500 to 7300 MPa, as well as high corrosion resistance. The results obtained make it possible to recommend MAO coatings on magnesium alloys both as an external (functional) layer and for the formation of an underlayer for the subsequent application of protective coatings (varnishes, polymers, polytetrafluoroethylene, in particular).