We develop a model where banks invest in reserves and loans, and face aggregate liquidity shocks. Banks with liquidity shortage sell loans on the interbank market. Two equilibria emerge. In the no default equilibrium, all banks hold enough reserves and remain solvent. In the mixed equilibrium, some banks default with positive probability. The former exists when credit market competition is intense. The latter emerges when banks exercise market power. Thus, competition is beneficial to financial stability. The structure of liquidity shocks affects the severity and the occurrence of crises, as well as the amount of credit available in the economy.