Magnesium alloys are susceptible to corrosion because of their high reactivity and low electrode potential. The present work introduces a conversion coating using a protic ammonium-phosphate ionic liquid (IL). Initial results on the AZ31B Mg alloy have demonstrated substantially improved corrosion resistance for the IL treatment at 300°C (IL_300C) compared to the treatment at room temperature. Potentiodynamic polarization analysis of the IL_300C treated Mg surface in a NaCl solution exhibited a strong passivation behavior. No pretreatment is needed and the treated surface morphology is well preserved. Cross-sectional nanostructure examination using transmission electron microscopy and element mapping using energy-dispersive X-ray spectroscopy have revealed the IL_300C conversion coating to be a 70–80nm thick with a two-layer structure. Further surface chemical analysis using X-ray photoelectron spectroscopy suggested such an IL conversion coating possibly composed of metal oxides, metal phosphates, and carbonaceous compounds.