Using a structural model of credit risk, we show that for low-ESG-rated firms, it is less expensive to borrow from banks than from public market compared to high-ESG-rated firms. As a result, after a company experiences an adverse ESG event, it starts borrowing more from banks than from the bond market. At the same time, we find that banks have incentives to discipline brown companies that they lend to: banks' stocks drop after a public announcement that a borrower experienced an adverse ESG event.