Due to the combination of many unique properties, magnesium alloys have been widely recognized as the suitable metallic material for degradable biomedical implants. However, extremely high degradation kinetics of magnesium alloys in physiological environment have hindered their clinical applications. This paper reports for the first time of using a novel microwave assisted coating process to deposit magnesium phosphate coatings on Mg alloy AZ31 and improve its the in vitro corrosion resistance. Results present that newberyite layer and trimagnesium phosphate hydrate (TMP) layer with distinct features were fabricated via various processing time and temperature. Afterwards, the corrosion resistance, degradation behavior, bioactivity and cytocompatibility of the magnesium phosphate coated AZ31 samples were investigated. The potentiodynamic polarization tests reveal that the corrosion current density of AZ31 magnesium alloy in SBF is significantly suppressed by the deposited magnesium phosphate coatings. Additionally, it is seen that magnesium phosphate coatings remarkably reduced the mass loss of AZ31 alloy after immersion in SBF for two weeks and promoted precipitation of apatite particles. The high viability of preosteoblast cells cultured with extracts of coated samples, indicates that the magnesium phosphate coatings can improve the cytocompatibility of AZ31 alloy. All of these attractive results suggest that magnesium phosphate coatings, serving as the protective and bioactive layer can enhance the corrosion resistance and biological response of magnesium alloy.