In this study we examine repairable systems with random lifetime. Upon failure, a maintenance action, specifying the degree of repair, is taken by a controller. The objective is to determine an age-dependent maintenance strategy which minimizes the total expected discounted cost over an infinite planning horizon. Using several properties of the optimal policy which are derived in this study, we propose analytical and numerical methods for determining the optimal maintenance strategy. In order to obtain a better insight regarding the structure and nature of the optimal policy and to illustrate computational procedures, a numerical example is analysed. The proposed maintenance model outlines a new research channel in the area of reliability with interesting theoretical issues and a wide range of potential applications in various fields such as product design, inventory systems for spare parts, and management of maintenance crews.