In this paper we consider a block replacement model in which a component can be replaced preventively at maintenance opportunities only. Maintenance opportunities occur randomly and are modelled through a renewal process. In the first, theoretical part of the paper we derive an optimality equation and show that the optimal opportunity block replacement policy can be described as a so-called one-opportunity-look-ahead policy. In the second, computational part we present an exact optimisation algorithm in case of K2-distributed times between opportunities. This algorithm can also be used as an approximative method in case of other times between opportunity distributions. Together with another approximative method, based on the stationary forward recurrence time distribution, its performance is checked with simulation.