Abstract In the operation of wastewater treatment plants a key variable is dissolved oxygen (DO) content in the bioreactors. As oxygen is consumed by the microorganisms, more oxygen has to be added to the water in order to comply with the required minimum dissolved oxygen concentration. This is done using a set of aerators working on/off that represents most of the plant energy consumption. In this paper a hybrid nonlinear predictive control algorithm is proposed, based on economic and control aims. Specifically, the controller minimizes the energy use while satisfying the time-varying oxygen demand of the plant and considering several operation constraints. A parameterization of the binary control signals in terms of occurrence time of events allows the optimization problem to be re-formulated as an nonlinear programming (NLP) problem at every sampling time. Realistic simulation results considering real perturbations data sets for the inlet variables are presented.