Autotrophic nitrogen removal after ureolytic phosphate precipitation to remove both endogenous and exogenous nitrogen.