The effects of heat treatment on the microstructure and mechanical properties of a ZW21 magnesium alloy are investigated. The results indicate that the interdendritic eutectic W phase with discontinuous laths and large-sized pools in the as-cast ZW21 alloy is harmful to its mechanical properties. But heat treatment including solution and subsequent aging can change the amount, size, morphology and distribution of the W phase, and thus can improve the mechanical properties. The treatment technique of solution at 525°C for 4h and subsequent aging at 250°C for 24h is appropriate for this alloy and can increase the ultimate tensile strength, elongation and hardness from 205MPa, 18.25% and 50HV of the as-cast alloy to 243MPa, 23.75% and 68.7HV, respectively. The fracture regimes such as quasi-cleavage or cleavage and the proportion of grain debonding in crack propagation also change with the treatment parameters. All of these changes are attributed to the variation of deformation harmony resulted from composition homogenization, grain growth and MgSnCa particle coarsening, or/and grain bonding strength determined by the distribution of W phase.