Considering the characteristics of large time variation, strong coupling, large time delay, and serious interference of wastewater treatment system, this article proposes an offline modeling and online controlling method based on long short-term memory network to improve multivariable control and prediction accuracy under disturbance. First, a prediction model of dissolved oxygen and nitrate nitrogen concentrations is established, and the stability of this long short-term memory-based modeling method is proven via the limitation of learning rate. Second, based on the prediction model, a multivariable long short-term memory-based controller is designed to improve the control accuracy by gradient descent algorithm, and the stability of the long short-term memory-based controller is proved by Lyapunov principle. Finally, based on the Benchmark Simulation Model No.1, the simulation experiments of long short-term memory-based modeling and controlling method, the default proportion–integration control method (proposed in the Benchmark Simulation Model No.1), and model predictive control method are conducted and compared, respectively. The results show the long short-term memory-based method owns both better approximating and controlling performance, and compared with the default proportion–integration and model predictive control, the long short-term memory-based controller reduces the integral squared error of dissolved oxygen and nitrate nitrogen concentrations by more than 94% and 80%, respectively.