This study was motivated by the high costs incurred by an energy company for repairable spare parts for faulty mission-critical items, particularly with those that operate until failure. The objective of this paper is to develop and apply a method for repairable spare part inventory management of run-to-failure equipment. To achieve a robust method that incorporates the data collected from previous failures, such as environmental factors and operating conditions, we propose an optimisation approach based on an accelerated failure time model. Accelerated failure time is used as a reliability regression model with covariates to describe different operational conditions. An algorithm is also developed to consider the repairable nature of the equipment, predicting the number of spare parts based on the expected number of failures in the period and the equipment repair cycle. The proposed method is applied using data from three different power units of electrical submersible pumps, a mission-critical item in oil production. The results show an average reduction of 60.6 per cent in the required number of spare parts, considering an average fill rate of 95.33 per cent. This reduction implies an estimated annual savings of around US$664,720 in inventory costs, considering the analysed units. 157 This work was motivated by the high investment in inventory of some mission-critical equipment by Petróleo Brasileiro S/A (Petrobras), a semi-public Brazilian corporation in the energy industry. The company, one of the largest in Latin America, operates in the areas of exploration, production, refining, commercialisation, and transport of oil, natural gas, and their derivatives. The immobilised capital in spare parts at Petrobras, considering all its operational units and subsidiaries, was estimated at around US$1.27 billion, based on the company's consolidated financial statement of 2015 (available for public access at http://www.petrobras.com.br/en/). Excess stock is directly linked to the risk of material lack-that is, stock that is used to absorb uncertainties related to maintenance demands. Given the complexity of spare parts dimensioning, the balance between the cost of material failure and immobilised capital is compromised, either by the excess or the lack of an item.