To fully exploit the possibilities of “smart” wells containing both measurement and control equipment, one can envision a system where the measurements are used for frequent updating of a reservoir model, and an optimal control strategy is computed based on this continuously updated model. We developed such a closed-loop control approach using an ensemble Kalman filter to obtain frequent updates of a reservoir model. Based on the most recent update of the reservoir model, the optimal control strategy is computed with the aid of an adjoint formulation. The objective is to maximize the economic value over the life of the reservoir. We demonstrate the methodology on a simple waterflooding example using one injector and one producer, each equipped with several individually controllable inflow control valves (ICVs). The parameters (permeabilities) and dynamic states (pressures and saturations) of the reservoir model are updated from pressure measurements in the wells. The control of the ICVs is rate-constrained, but the methodology is also applicable to a pressure-constrained situation. Furthermore, the methodology is not restricted to use with “smart” wells with down-hole control, but could also be used for flooding control with conventional wells, provided the wells are equipped with controllable chokes and with sensors for measurement of (wellhead or down hole) pressures and total flow rates. As the ensemble Kalman filter is a Monte Carlo approach, the final results will vary for each run. We studied the robustness of the methodology, starting from different initial ensembles. Moreover, we made a comparison of a case with low measurement noise to one with significantly higher measurement noise. In all examples considered, the resulting ultimate recovery was significantly higher than for the case of waterflooding using conventional wells. Furthermore, the results obtained using closed-loop control, starting from an unknown permeability field, were almost as good as those obtained assuming a priori knowledge of the permeability field.