This paper presents a rainfall forecast-based real-time optimal operation model of urban drainage systems (UDSs) investigating the role of rainfall forecasts in predictive real-time operation of UDSs. Two rainfall forecast models, namely long short-term memory (LSTM) and optimized-by-PSO (particle swarm optimization) support vector regression, are linked to an integrated simulation–optimization model. For any given operation policies, the rainfall-runoff stormwater management model (SWMM) simulates the urban system’s operation under flooding conditions in which the operation policies are optimized by the metaheuristic harmony search (HS) optimizer. The objective function of the HS algorithm is minimizing flood volumes at control points. The presented approach is therefore a dynamic predictive real-time operation (PRTOP) model that continuously updates rainfall forecasts and operational decisions during flood events. The performance of the developed forecast-based integrated SWMM-HS simulation–optimization modeling framework is tested through its application in a real urban system case study located in Tehran, Iran. Results demonstrate that a notable reduction in flood volume (11.8%) is achieved by using the LSTM-driven rainfall forecasts in the proposed PRTOP model compared to a reactive real-time operation (RTOP) model not utilizing rainfall forecasts.