Obtaining more accurate flood information downstream of a reservoir is crucial for guiding reservoir regulation and reducing the occurrence of flood disasters. In this paper, six popular ML models, including the support vector regression (SVR), Gaussian process regression (GPR), random forest regression (RFR), multilayer perceptron (MLP), long short-term memory (LSTM) and gated recurrent unit (GRU) models, were selected and compared for their effectiveness in flood routing of two complicated reaches located at the upper and middle main stream of the Yangtze River. The results suggested that the performance of the MLP, LSTM and GRU models all gradually improved and then slightly decreased as the time lag increased. Furthermore, the MLP, LSTM and GRU models outperformed the SVR, GPR and RFR models, and the GRU model demonstrated superior performance across a range of efficiency criteria, including mean absolute percentage error (MAPE), root mean square error (RMSE), Nash–Sutcliffe efficiency coefficient (NSE), Taylor skill score (TSS) and Kling–Gupta efficiency (KGE). Specifically, the GRU model achieved reductions in MAPE and RMSE of at least 7.66% and 3.80% in the first case study and reductions of 19.51% and 11.76% in the second case study. The paper indicated that the GRU model was the most appropriate choice for flood routing in the Yangtze River.