Mg alloy corrosion susceptibility is a major issue that limits its wide industrial application in transport, energy and medical sectors. A corrosion-resistant layer containing crystalline MgCO3 was formed on the surface of AZ91D Mg alloy by Li salt loading and thermal CO2 treatment. Compared to the uncoated AZ91D surface, the surface layer exhibited up to a ∼15-fold increase in corrosion resistance according to the electrochemical results in 3.5 wt% NaCl solution and ∼32% decrease in wear rate compared to untreated AZ91D. The improved corrosion resistance is attributed to the formation of a <10 μm thick dense layer containing Mg, O, C and Li with crystalline MgCO3 phases. The initial step was to form a porous MgO layer on the surface of AZ91D Mg alloy, followed by loading an alkali metal salt (i.e., LiNO3) onto the MgO surface. The porous MgO surface was then reconstructed into a dense insulation layer containing Mg carbonate through CO2 absorption facilitated by molten Li salt during thermal CO2 treatment at 350 °C. As a potential method to utilize excessive CO2 for beneficial outcomes, the formation of the carbonate-containing film introduced in this study opens a new pathway for protecting various existing Mg alloys for diverse industrial applications.