Wetland and floodplain ecosystems along many regulated rivers are highly stressed, primarily due to a lack of environmental flows of appropriate magnitude, frequency, duration, and timing to support ecological functions. In the absence of increased environmental flows, the ecological health of river ecosystems can be enhanced by the operation of existing and new flow-control infrastructure (weirs and regulators) to return more natural environmental flow regimes to specific areas. However, determining the optimal investment and operation strategies over time is a complex task due to several factors including the multiple environmental values attached to wetlands, spatial and temporal heterogeneity and dependencies, nonlinearity, and time-dependent decisions. This makes for a very large number of decision variables over a long planning horizon. The focus of this paper is the development of a nonlinear integer programming model that accommodates these complexities. The mathematical objective aims to return the natural flow regime of key components of river ecosystems in terms of flood timing, flood duration, and interflood period. We applied a 2-stage recursive heuristic using tabu search to solve the model and tested it on the entire South Australian River Murray floodplain. We conclude that modern meta-heuristics can be used to solve the very complex nonlinear problems with spatial and temporal dependencies typical of environmental flow allocation in regulated river ecosystems. The model has been used to inform the investment in, and operation of, flow-control infrastructure in the South Australian River Murray.