Before the water can be discharged, it must be purified to remove the nitrogen and phosphorus.
Nitrogen is removed by a process called de-nitrification which, when completed, allows the nitrogen to be released to the atmosphere.
The phosphorus is removed from the water by chemical precipitation or biologically. The sludge is rich in phosphorus can be dried and sold as fertiliser.
The removal of the nitrogen and phosphorus is important as they both can cause algae bloom, which in turn starves water of oxygen killing the indigenous biota.
Finally before discharge the water is disinfected using a variety of methods. The purpose of this final water treatment is to remove harmful microbes which still lurk in the wastewater after previous treatments.
The methods of disinfection are; chlorine dosing, UV light, and ozone treatment, but the most popular and the cheapest method is chlorination.