This paper studies the dynamics of credit supply when a negative shock impacts a substantial share of bank loans. The analysis exploits the 2014 collapse of energy prices, using the universe of Mexican commercial bank loans. The findings show that, after the drop in energy prices, the credit default swap spreads (CDS) of firms in the energy sector soared, and banks that were more exposed to the energy sector increased even more their exposure ex post, by supplying loans to their larger debtors in the energy sector at lower interest rates. An increase of one standard deviation in ex-ante exposure to the energy sector increased loan volume to borrowers in the sector by 18 percent and reduced loan rates charged by 6 percent, even though borrower?s CDS spreads were widening. Highly exposed banks amplified this sector-specific shock to the rest of the economy by contracting lending to other sectors, with important real effects, as the borrowers could not switch credit suppliers. Finally, the energy price shock had a large negative impact on macro outcomes, especially in the capital-intensive secondary sector. Quantitatively, a one standard deviation increase in the exposure of a state's banks to the energy sector reduces its GDP by 1.8 percent.