A surface treatment process, composed of plasma electrolytic oxidation (PEO) and sealing by temporary oil preservation system containing corrosion inhibitors, was performed on AZ31 magnesium alloy in order to improve its corrosion resistance in environments containing chlorides. Both atmospheric and immersion conditions were evaluated by electrochemical tests in 0.1M NaCl solution together with salt spray test according to STN EN ISO 9227 standard. The obtained results confirmed significant improvement of corrosion resistance reached by the PEO sealing in aggressive environments compared to the pure PEO coating on AZ31 surface. Hence, such a duplex coating is a very perspective alternative for magnesium alloy applications in severe conditions or for temporary protection of magnesium products coated by the PEO during marine transport.