Effects of Ca2+ and Mg2+ on the CO2 corrosion behaviors of tube steel were studied in simulated oil-fieldenvironment. The influence of Ca2+ and Mg2+ on the corrosion rate and morphologies of corrosion product layerwas determined by scanning electron microscope and measuring mass loss. Potentiodynamic polarization and im-pedance spectroscopy were used to investigate the change of electrochemical characteristic parameters of corrosionproduct layer and corrosion dynamic process. The results show that with Ca2+ and Mg2+ in electrolyte, the mor-phologies and microstructures of corrosion product layer changed obviously, thus affecting the corrosion process.