We introduce costly internal capital into a standard insurance model, in which a risk-averse policy holder buys insurance from a risk-neutral insurer with limited liability. We show that the optimal contract is unique, and leads to a positive probability for insurer default. Some risks are uninsurable, in the sense that it is optimal for the insurer not to provide insurance against such risks. We characterize when such situations arise, as a function of the properties of the risk, the cost of internal capital, and the policy holder's utility function. An increase in the cost of capital may lead to a higher optimal amount of internal capital. The results continue to hold when there are multiple policy holders who are exposed to identical risks. This extension of the classical model to include costly internal capital provides a fruitful approach to many real world insurance markets.