The high corrosion susceptibility of magnesium alloy has become a practical problem which restricts its wide application in many fields. To improve its surface properties, a composite coating has been successfully prepared on the surface of AZ91D magnesium alloy using a one‐step hydrothermal method. The coating surface possesses a dense structure in the form of scales and has an adhesion strength of 3B. The effect of different preparation conditions on the coating thickness and corrosion resistance is discussed. The coating heated at 180°C for 2 h showed the best corrosion resistance in a 3.5 wt% sodium chloride solution, with a reduction in corrosion current density of 5 orders of magnitude compared to the bare sample. This solution significantly improved the corrosion resistance of the magnesium alloy and helped to further realize the application of magnesium alloys in corrosive environments.