Conversion coatings on the magnesium alloy AZ81 were prepared using the phosphate–permanganate baths differing in composition. The corrosion behavior of the coated and uncoated alloys has been investigated by electrochemical impedance spectroscopy (EIS) and linear polarization methods. The choice of proper electric equivalent circuit (EEC) is discussed. The effect of temperature, bath composition and time of conversion as well as etching in acids before application on the corrosion resistance of the coated alloy has been evaluated. The best corrosion resistance was obtained for the samples coated in the bath containing 25g KMnO 4 , 150g Na 2 HPO 4 and 50ml H 3 PO 4 in 1 dcm 3 , applied at 80°C. Differences in the morphology and composition of coated surfaces were investigated by the scanning electron microscopy (SEM) and X-ray photoelectron spectroscopy (XPS) techniques and correlated with the corrosion resistance of the samples.