We discuss a continuous single-item production–inventory model in which production rates r = a > 0 or r = 0 are available. The production is going directly into inventory. The demand for the product is governed by a compound Poisson process. The inventory levels are continuously controlled in order to cope with random fluctuations in the demand. The outstanding demands are partially backlogged and partially lost. The corresponding production policy is determined by two critical inventory levels. Relevant costs are a linear inventory holding cost, a linear backorder cost and, a fixed set up cost for initiating a production run. As a service measure, we consider the average amount of lost sales per unit time. The corresponding optimization problem is discussed. The optimal control policy is determined with the help of theory of regenerative and renewal processes which enables us to find the precise optimal policy instead of using approximations. As a special case we obtain the solution for completely backlogged excess demand.