To enhance the mechanical properties and poor corrosion resistance of magnesium alloy in vitro, the as‐cast Mg–2Zn–0.5Zr–1.5Dy (mass%) magnesium alloy was subjected to two types of extrusion treatment, one is hot extrusion (denoted as ET alloy), the other is heat treatment followed by hot extrusion (denoted as HE alloy). The microstructure, mechanical properties, and corrosion behaviors of these extruded alloys are assessed. The results show that the HE alloy has superior mechanical properties and a slower corrosion rate than the ET alloy. The yield strength and elongation of the HE alloy reach 287 ± 10 MPa and 17.6 ± 0.5%, respectively, and its corrosion rate is only 0.59 ± 0.16 mm year−1. After hot extrusion, microscale and nanoscale second‐phase exist in the extruded alloys, and the nanoscale second‐phase can improve their mechanical properties by second‐phase strengthening. However, the presence of microscale second phase can cause galvanic corrosion and result in poor corrosion resistance. The HE alloy has good properties due to it containing more nanoscale second‐phase and fewer microscale second‐phase.