Wastewater treatment is carried out in a complex set of steps, in which the wastewater is treated by means of complex biological, physical, and chemical processes. Today, plants are often operated in a conservative and inefficient risk-averse mode, without the ability to quantify the risk or truly minimize the costs. An innovative Operational control applying descriptive (historical data analysis for a simulation model design and plant state estimation); predictive (wastewater process behavior modeled by a transition probability matrix), and prescriptive analytics (Markov Decision Process) was developed. The system was deployed in Lleida (Spain). Use of the system resulted in a dramatic 13.5 percent general reduction in the plant’s electricity consumption; a 14 percent reduction in the amount of chemicals needed to remove phosphorus from the water; and a 17 percent reduction in sludge production.