The formation processes of a composite ceramic coating on AM50 magnesium alloy prepared by plasma electrolytic oxidation (PEO) in a K 2 ZrF 6 electrolyte solution were studied by scanning electron microscope (SEM) and energy dispersive X-ray spectroscope (EDX). Electrochemical impedance spectroscopy (EIS) tests were used to study the variation of the corrosion resistance of the coating during the PEO treatment. The results show that the coating formed on Mg alloy is mainly composed of MgO and MgF 2 when the applied voltage is lower than the sparking voltage, and zirconium oxides start to be deposited on Mg substrate after the potential exceeding the sparking voltage. The corrosion resistance of the coating increases with increasing the applied voltage.