The goal of this work was to study the effective recovery of phosphorus from the supernatant of anaerobic digestion of sewage sludge by precipitation as struvite. The formation of struvite is envisioned as a promising process for nutrient removal and subsequent recovery, thus providing a strong incentive for its implementation, since the sewage is a renewable source of phosphorus. Struvite precipitation was obtained by controlled addition of Mg(OH)2 or MgCl2. We evaluated the removal of ammonia and phosphate under equimolar conditions of magnesium and magnesium stoichiometric excess of 100 to 200% relative to the limiting reagent, under a stirring speed of 300 rpm at pH 8, 9 and 10. The best condition was MgCl2 in 1:1 molar ratio to phosphate, considering the stoichiometric ratio [PO43−]:[NH4+] of 0.13 (presented by raw sample). The results show the best cost-benefit ratio, removal of phosphate of 90.6% and ammonium removal of 29%, resulting in 23 mg l−1 PO43− and 265 mg l−1 NH4+ concentration in effluent.