This study aims to address elemental segregation and poor mechanical properties in as-deposited AZ91D magnesium alloy fabricated via wire arc additive manufacturing through heat treatment. Three distinct heat treatments are investigated: solution treatment (T4), artificial aging treatment (T5), and a combination of solution and aging treatment (T6). Microstructural analysis reveals equiaxed grains in all samples. In the T4 state, the eutectic phase along grain boundaries dissolvs into the matrix, reducing elemental segregation but increasing grain size. In the T5 state, elemental segregation is further reduced; however, due to the relatively low aging temperature, the microstructural features of the as-deposited state are largely retained. In the T6 state, solution treatment increases grain sizes, and the uneven distribution of the reprecipitated β phase leads variations in mechanical properties between vertical and horizontal directions. Compared to the as-deposited state, the T6 treatment achieves a synergistic improvement in both strength and ductility. The ultimate tensile strength increases to 262.3 MPa, and the elongation rises to 13.8%, representing improvements of 12.5% and 32.7%, respectively, compared to the as-deposited values of 233.2 MPa and 10.4%.