This paper develops a dynamic stochastic general equilibrium model with interactions between an heterogeneous banking sector and other private agents. We introduce endogenous default probabilities for both firms and banks, and allow for bank regulation and liquidity injection into the interbankmarket. Our aim is to understand the importance of supervisory and monetary authorities to restore financial stability. The model is calibrated against real data and used for simulations. We show that liquidity injections reduce financial instability but have ambiguous effects on output fluctuations. The model also confirms the partial equilibrium literature results on the procyclicality of Basel II.