0.3%, 0.9% (mass fraction) rare earth Y and 0.4%, 1.0% (La, Ce) mixed rare earth were added to the AZ91 Mg alloy, respectively. Scanning electron microscopy (SEM), scanning Kelvin probe force microscopy (SKPFM) and electrochemical testing techniques were used to study the corrosion behavior of Mg alloy. X-ray diffraction (XRD) and photoelectron spectroscope (XPS) were used to determine the composition and structure of the corrosion product film. It was clarified that the influence of different types and contents of rare earth on the corrosion behavior of AZ91 Mg alloy. The results show that both rare earth elements can reduce the corrosion rate and improve the corrosion resistance of AZ91 Mg alloy. The effect of different types of rare earth on corrosion behavior of AZ91 Mg alloy depends not only on the potential difference between the precipitated phase and the matrix, but also on the influence mechanism of rare earth on the microstructure and surface film of Mg alloy. Rare earth La participates in the formation of corrosion products during the corrosion process, which increases the integrity of the surface film, but the passivation ability of the surface film is not as good as the passivation effect produced by the Y-containing Mg alloy. Rare earth Y reduces the mass fraction of β-Mg17Al12 phase in the alloy and weakens its micro-galvanic corrosion effect. The role of rare earth Y in improving the corrosion resistance is more obvious than that of (La, Ce) mixed rare earth. The corrosion rate of AZ91 Mg alloy with 0.9%Y addition is lower than that of Mg alloy containing 0.3%Y. The corrosion resistance of Mg alloy with 0.4% (La, Ce) mixed rare earth is similar to that of Mg alloy with 1.0% (La, Ce). © 2021, Science Press. All right reserved.