Summary Here we develop a new control model of water injection from a growing hydrofracture into a layered soft rock. We demonstrate that in transient flow, the optimal injection pressure depends not only on the instantaneous measurements, but also on the whole history of injection, growth of the hydrofracture, and the rock damage. Based on the new model, we design an optimal injection controller that manages the rate of water injection in accordance with hydrofracture growth and the formation properties. We conclude that maintaining the rate of water injection into a low-permeability rock above a reasonable minimum inevitably leads to hydrofracture growth, to establishment of steady-state flow between injectors and neighboring producers, or to a mixture of both. Analysis of field water injection rates and wellhead pressures leads us to believe that direct links between injectors and producers can be established at early stages of waterflood, especially if the injection policy is aggressive. Such links may develop in thin, highly permeable reservoir layers or may result from failure of the soft rock under stress exerted by injected water. These links may conduct a substantial part of injected water. Based on the field observations, we now consider a vertical hydrofracture in contact with a multilayer reservoir, where some layers have high permeability and quickly establish steady-state flow from an injector to neighboring producers. The main result of this paper is the development of an optimal injection controller for purely transient flow, and for mixed transient/steady-state flow in a layered formation. The objective of the controller is to maintain the prescribed injection rate in the presence of hydrofracture growth and injector/producer linkage. The history of injection pressure and cumulative injection, along with estimates of the hydrofracture size, are the controller inputs. By analyzing these inputs, the controller outputs an optimal injection pressure for each injector. When designing the controller, we keep in mind that it can be used either offline as a smart adviser, or online in a fully automated regime. Because our controller is process model-based, the dynamics of actual injection rate and pressure can be used to estimate effective area of the hydrofracture and the extent of the rock damage. The latter can be passed to the controller as one of the inputs. Finally, a comparison of the estimated fracture area with independent measurements leads to an estimate of the fraction of injected water that flows directly to the neighboring producers through links or thief-layers.