The effects of on-line solution, off-line solution and aging heat treatment on the microstructure and hardness of the die-cast AZ91D alloys were investigated. Brinell hardness of die-cast AZ91D alloy increases through on-line solution and off-line aging treatment but decreases after off-line solution treatment. By X-ray diffractometry, optical microscopy, differential thermal analysis, scanning electron microscopy and X-ray energy dispersive spectroscopy, it is found that the microstructures of the die-cast AZ91D magnesium alloy before and after on-line solution and off-line aging are similar, consisting of α-Mg and β-Al12Mg17. The precipitation of Al element is prevented by on-line solution so that the effect of solid solution strengthening is enhanced. The β-Al12Mg17 phases precipitate from supersaturated Mg solid solution after off-line aging treatment, and lead to microstructure refinement of AZ91D alloy, so the effect of precipitation hardening is enhanced. The β-Al12Mg17 phases dissolve in the substructure after off-line solution treatment, which leads to that the grain boundary strengthening phase is reduced significantly and the hardness of die cast AZ91D is reduced.