The aim of this study was to enrich the composition of anaerobic digester sludge in terms of nitrogen and phosphorus by struvite (MgNH4PO4) formation. Waste activated sludge was anaerobically digested in batch reactors under the conditions that the minimum stoichiometric requirement for struvite formation was satisfied in all reactors. For this purpose, different amounts of magnesium (Mg2+) and phosphate (PO43-) ions were added initially to the batch reactors. The results showed the effects of adding Mg2+ and PO43- ions on the performance of anaerobic digestion and on the amounts of ammonium (NH4+) and PO43- ions released during digestion. The results indicated that the performance of the anaerobic digestion in chemical oxygen demand removal changed between 4.0% and 15.4% for a Mg2+ concentration range of 277.2 to 529.3 mg/L and a PO43- concentration range of 377.4 to 2372.4 mg/L. There was an increase in the concentration of NH4+ in all reactors during digestion, but the extent of concentration increase could be controlled by increasing the initial concentrations of Mg-2(+) and PO43-. The maximum removal of NH4+ ions (33.7%) was observed in the reactor dosed initially by Mg2+ and PO43- concentrations of 467.2 and 2123.3 mg/ L, respectively. The concentration of PO43- ion was lower than its initial concentration in all reactors, indicating considerable fixation of PO43- as it was released, by struvite and other solid species formation. The decrease in the concentration of Mg2+ ions similar to PO43- was accepted as evidence for the formation of solid species composed of Mg2+ and PO43, in addition to struvite. Water Environ. Res., 81, 2447 (2009).