During the last years, machine learning-based control and optimization systems are playing an important role in the operation of wastewater treatment plants in terms of reduced operational costs and improved effluent quality. In this paper, a machine learning-based control strategy is proposed for optimizing both the consumption and the number of regulation violations of a biological wastewater treatment plant. The methodology proposed in this study uses neural networks as a soft-sensor for on-line prediction of the effluent quality and as an identification model of the plant dynamics, all under a neuro-genetic optimum model-based control approach. The complete scheme was tested on a simulation model of the activated sludge process of a large-scale municipal wastewater treatment plant running under the GPS-X simulation frame and validated with operational gathered data, showing optimal control performance by minimizing operational costs while satisfying the effluent requirements, thus reducing the investment in expensive sensor devices.