We analyze the transmission of changes in commodity prices to bank lending in a large sample of developing countries. A bank‐level analysis shows that a fall in commodity net export prices is associated with a reduction of bank lending, particularly for commodity exporters and during episodes of terms‐of‐trade decline. We complement this analysis with loan‐level data from a credit register, which allows us to identify the effect of a commodity price shock on the supply of credit, controlling for unobserved factors that could drive borrowers' credit demand. Results show that banks with relatively lower deposits and poor asset quality transmit the changes in commodity prices to lending more aggressively. (JEL F30, F34, G21, Q02)