We examine the impact of banks' exposure to market liquidity shocks through wholesale funding on their supply of credit during the financial crisis in the United States. We focus on mortgage lending to minimize the impact of confounding demand factors that could potentially be large when comparing banks' overall lending across heterogeneous categories of credit. The disaggregated data on mortgage applications that we use allows us to study the time variations in banks' decisions to grant mortgage loans, while controlling for bank, borrower, and regional characteristics. The wealth of data also allows us to carry out matching exercises that eliminate imbalances in observable applicant characteristics between wholesale and retail banks, as well as various other robustness tests. We find that banks that were more reliant on wholesale funding curtailed their credit significantly more than retail-funded banks during the crisis. The demand for mortgage credit, on the other hand, declined evenly across wholesale and retail banks. To understand the aggregate implications of our findings, we exploit the heterogeneity in mortgage funding across U.S. Metropolitan Statistical Areas (MSAs) and find that wholesale funding was a strong and significant predictor of a sharper decline in overall mortgage credit at the MSA level.