We consider a classical risk model and its diffusion approximation, where the individual claims are reinsured by a reinsurance treaty with deductible b ∈ [0, b̃]. Here b = b̃ means ‘no reinsurance’ and b= 0 means ‘full reinsurance’. In addition, the insurer is allowed to invest in a riskless asset with some constant interest rate m > 0. The cedent can choose an adapted reinsurance strategy {b t }t≥0, i.e. the parameter can be changed continuously. If the surplus process becomes negative, the cedent has to inject additional capital. Our aim is to minimise the expected discounted capital injections over all admissible reinsurance strategies. We find an explicit expression for the value function and the optimal strategy using the Hamilton-Jacobi-Bellman approach in the case of a diffusion approximation. In the case of the classical risk model, we show the existence of a ‘weak’ solution and calculate the value function numerically.