This study explores the causal relationship between population shocks and housing prices in Swedish municipalities. Using a spatial difference-in-differences (DiD) methodology, we analyse data from 290 municipalities over 24 years (1998--2022) to identify the impact of unexpected demographic changes on housing market dynamics. Our approach compares municipalities experiencing significant negative population shifts (treatment group) with those with stable population trends (control group), utilising cumulative summation (CUSUM) tests to identify shocks. The findings indicate that population shocks significantly affect housing prices, with unexpected population declines leading to a 5–10% decrease over 1–6 years after the shock. The impact is more pronounced in smaller municipalities than in larger municipalities with a less elastic housing supply. These results emphasise the critical role of demographic changes in shaping housing markets.