Detention ponds can mitigate flooding and improve water quality by allowing the settlement of pollutants. Typically, they are operated with fully open orifices and weirs (i.e., passive control). Active controls can improve the performance of these systems: orifices can be retrofitted with controlled valves, and spillways can have controllable gates. The real-time optimal operation of its hydraulic devices can be achieved with techniques such as Model Predictive Control (MPC). A distributed quasi-2D hydrologic-hydrodynamic coupled with a reservoir flood routing model is developed and integrated with an MPC algorithm to estimate the operation of valves and movable gates in real-time. The control optimization problem is adapted to switch from a flood-related algorithm focusing on mitigating floods to a heuristic objective function that aims to increase the detention time when no inflow hydrographs are predicted. The case studies show the potential results of applying the methods developed in a catchment in Sao Paulo, Brazil. The performance of MPC compared to alternatives that do not change the operation over time with either fully or partially open valves and gates are tested. Comparisons with HEC-RAS 2D indicate volume and peak flow errors of approximately 1.4% and 0.91% for the watershed module. Simulating two consecutive 10-year storms shows that the MPC strategy can achieve peak flow reductions of 79%. In contrast, the passive scenario has nearly half of the performance (41%). A 1-year continuous simulation results show that the passive scenario with 25% of the valves opened can treat 12% more runoff compared to the developed MPC approach, with an average detention time of approximately 6 h. For the MPC approach, however, the average detention time is nearly 14 h, indicating that both control techniques can treat similar volumes; however, the proxy water quality for the MPC approach is enhanced due to the longer detention times achieved.