Corrosion behavior of AZ31 magnesium alloy based on marine scientific ocean voyage was investigated by using scanning electron microscope (SEM), X-Ray Diffraction (XRD), X-ray photoelectron spectroscopy (XPS) and electrochemical measurements. The results revealed that the AZ31 magnesium alloy suffered serious corrosion during exposure in marine atmosphere of ocean voyage. The corrosion rate was 52.23 μm∙y−1 and the maximum depth of corrosion pits was 105.84 μm after exposure for 1 year. The main corrosion products formed on AZ31 magnesium were Mg5(CO3)4(OH)2·4H2O, MgCO3·3H2O and Mg2(OH)3Cl·4H2O. Chloride ion plays an important role in the corrosion process of AZ31 magnesium alloy during ocean voyage. The corrosion of AZ31 magnesium alloy was initiated from pitting corrosion and evolved into general corrosion. This study will provide effective data for the application of magnesium alloy in marine equipment.