In this paper, the maintenance problem for a deteriorating system with k +1 failure modes, including an unrepairable failure (catastrophic failure) mode and k repairable failure (non‐catastrophic failure) modes, is studied. Assume that the system after repair is not ‘as good as new’ and its deterioration is stochastic. Under these assumptions, an extended replacement policy N is considered: the system will be replaced whenever the number of repairable failures reaches N or the unrepairable failure occurs, whichever occurs first. Our purpose is to determine an optimal extended policy N
* such that the average cost rate (i.e. the long‐run average cost per unit time) of the system is minimized. The explicit expression of the average cost rate is derived, and the corresponding optimal extended policy N
* can be determined analytically or numerically. Finally, a numerical example is given to illustrate some theoretical results of the repair model proposed in this paper.