A composite film composed of crystalline Equation or symbol description not availableTiO2 and Equation or symbol description not availableMgF2 was successfully deposited on magnesium alloy AZ31 from a liquid phase through a single-step process. The film had a thickness of ca. 370 nm and was composed of aggregations of nanoparticles whose diameters were in the range of 50–100 nm. During the corrosion tests, the coated AZ31 substrate showed a higher corrosive resistance than the uncoated AZ31. Potentiodynamic polarization curve measurements revealed that a clear passive region approaching ca. 280 mV could be observed on the curve of the coated AZ31 substrate. The formation and corrosion mechanism of the coated AZ31 substrate has also been discussed.