A direct electroless nickel-phosphorous (Ni-P) coating was obtained on AZ31 magnesium alloy after dipping in phosphate pickling bath. The deposition process and the properties of Ni-P coating on magnesium alloy were investigated by measuring open potential-time curves in situ and polarization curves in combination with X-ray fluorescene spectrometry, X-ray diffractometer and scanning electron microscopy. The results showed that after phosphate pickling pretreatment, the Mg-Mn phosphate film formed on magnesium alloy surface made the electrode potential of magnesium alloys shift to the positive direction. The Ni-P coating was compact, uniformly covered the magnesium alloy surface, with high phosphorus content (for about 10.3 wt%). The hardness of electroless Ni-P coating for 60 min was 552.4 HV, which is far higher than that of the Mg alloy substrate. The corrosion potential of electroless Ni-P coating for 60 min was -0.323 V vs. SCE, and shifted to the positive direction by 1198 mV, as compared to magnesium alloy substrate. The corrosion resistance of the magnesium alloy could be greatly increased by the formations of Mg-Mn phosphate film and electroless Ni-P coating.