For the Cramér-Lundberg risk model with phase-type claims, it is shown that the probability of ruin before an independent phase-type time H coincides with the ruin probability in a certain Markovian fluid model and therefore has an matrix-exponential form. When H is exponential, this yields in particular a probabilistic interpretation of a recent result of Avram & Usabel. When H is Erlang, the matrix algebra takes a simple recursive form, and fixing the mean of H at T and letting the number of stages go to infinity yields a quick approximation procedure for the probability of ruin before time T. Numerical examples are given, including a combination with extrapolation.