This paper studies the impact of unemployment insurance (UI) on the housing market. Exploiting heterogeneity in UI generosity across US states and over time, we find that UI helps the unemployed avoid mortgage default. We estimate that UI expansions during the Great Recession prevented more than 1.3 million foreclosures and insulated home values from labor market shocks. The results suggest that policies that make mortgages more affordable can reduce foreclosures even when borrowers are severely underwater. An optimal UI policy during housing downturns would weigh, among other benefits and costs, the deadweight losses avoided from preventing mortgage defaults.