In this paper we consider a risk model where claims arrive according to a Markovian arrival process (MAP). When the surplus becomes negative or the insurer is in deficit, the insurer could borrow money at a constant debit interest rate to repay the claims. We derive the integro-differential equations satisfied by the discounted penalty functions and discuss the solutions. A matrix renewal equation is obtained for the discounted penalty function provided that the initial surplus is nonnegative. Based on this matrix renewal equation, we present some asymptotic formulae for the discounted penalty functions when the claim size distributions are heavy tailed.