We study sources of debt for companies with poor ESG performance. 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. The stronger the market’s reaction and the more adverse events borrowers experience, the higher loan spreads that the banks set for their brown borrowers. We conclude that both loan and bond markets offer higher costs of debt to brown firms, but the bond market’s “punishment” is higher than the loan market’s.