Abstract In this paper we present a method to obtain optimal replacement time of a complex system which is subject to maintenance. We assume that any maintenance operation is a change of a certain component of the system or restores the component to a state as good as new. Based on the lifetime distribution function and the repair costs of the components we obtain the expected life cycle costs of the system. The optimal replacement time is given as the time at which the life cycle costs become minimal. Moreover, we derive an expression for the expected resale price based on the conception that the expected life cycle costs for all owners of the system should be equal.