Rare earth salt SmCl3 was added to the electrolyte to improve the corrosion performance of the AZ91D magnesium alloy plasma electrolytic oxidation (PEO) coating. The influence of SmCl3 on coating formation, morphology and performance was investigated. The results showed that adding SmCl3 can not only refine the discharge holes but also improve the coating's formation efficiency and its’ combination with the substrate. Potentiodynamic polarisation (PDS) and electrochemical impedance spectroscopy (EIS) tests showed that the corrosion characteristics of the PEO coating were greatly improved with SmCl3's addition. The corrosion current density decreased from 8.208 × 10−4 to 3.733 × 10−8 A cm−2 when the presence of optimum level of SmCl3 in solution (0.25 g L−1). Cyclic polarisation test indicated that the pitting corrosion of AZ92D was improved.