This study investigates the effect of the large shock to energy prices following the Russian invasion of Ukraine on bank credit to firms. To isolate the causal effect of the shock, it compares bank lending to high-energy-intensive firms to that of similar low-energy-intensive firms. Following the shock, bank credit to high-energy-intensive firms persistently declined, while their interest rates on new loans rose and other loan terms tightened. Across the distribution, safer firms reduced outstanding credit lines and paid unchanged interest rates on new bank loans, while riskier firms borrowed at higher interest rates.