This paper investigates a system whose deterioration is expressed as a continuous-time Markov process. It is assumed that the state of the system cannot be identified without inspection. This paper derives an optimal policy minimizing the expected total long-run average cost per unit time. It gives the optimal time interval between successive inspections and determines the states at which the system is to be replaced. Furthermore, under some reasonable assumptions reflecting the practical meaning of the deterioration, it is shown that the optimal policy has monotonic properties. A control limit rule holds for replacement, and the time interval between successive inspections decreases as the degree of deterioration increases.