In this study, a plant-wide model describing the fate of C, N and P compounds, upgraded to account for (on-site/off-site) greenhouse gas (GHG) emissions, was implemented within the International Water Association (IWA) Benchmarking Simulation Model No. 2 (BSM2) framework. The proposed approach includes the main biological N2O production pathways and mechanistically describes CO2 (biogenic/non-biogenic) emissions in the activated sludge reactors as well as the biogas production (CO2/CH4) from the anaerobic digester. Indirect GHG emissions for power generation, chemical usage, effluent disposal and sludge storage and reuse are also included using static factors for CO2, CH4 and N2O. Global and individual mass balances were quantified to investigate the fluxes of the different components. Novel strategies, such as the combination of different cascade controllers in the biological reactors and struvite precipitation in the sludge line, were proposed in order to obtain high plant performance as well as nutrient recovery and mitigation of the GHG emissions in a plant-wide context. The implemented control strategies led to an overall more sustainable and efficient plant performance in terms of better effluent quality, reduced operational cost and lower GHG emissions. The lowest N2O and overall GHG emissions were achieved when ammonium and soluble nitrous oxide in the aerobic reactors were controlled and struvite was recovered in the reject water stream, achieving a reduction of 27% for N2O and 9% for total GHG, compared to the open loop configuration.