The paper discusses the risk of ruin in insurance coverage of an epidemic in a closed population. The model studied is an extended susceptible–infective–removed (SIR) epidemic model built by Lefèvre and Simon (Methodology Comput. Appl. Prob.22, 2020) as a block-structured Markov process. A fluid component is then introduced to describe the premium amounts received and the care costs reimbursed by the insurance. Our interest is in the risk of collapse of the corresponding reserves of the company. The use of matrix-analytic methods allows us to determine the distribution of ruin time, the probability of ruin, and the final amount of reserves. The case where the reserves are subjected to a Brownian noise is also studied. Finally, some of the results obtained are illustrated for two particular standard SIR epidemic models.