Housing prices in the nation’s largest cities increased last year at the fastest pace in three decades, though rising mortgage rates could cool the red-hot market this year.

National home prices rose by 18.8% from a year earlier, according to the S&P CoreLogic Case-Shiller Index released Tuesday. The widely-watched 20-city composite saw an annual gain of 18.6% compared to 18.3% the month prior.

The increase was prompted by more Americans working from home and relocating, low interest rates and low supply. The spikes last year priced many people out of the market and hiked rents as well, contributing to runaway inflation that plagues buyers. High inflation looms as a liability for Democrats trying to keep majorities in congress during this year’s midterm elections.

“We’ve seen higher annual rates for this particular measure,” said Jennifer Lee, senior economist at the Bank of Montreal. “The overarching issue right now that everyone’s facing is just higher prices and inflation.”

Price increases moderated in the fall, but picked up again in December after officials signaled that they planned to increase interest rates to slow runaway inflation.

“The fear that the rates are going to be rising a lot more sharply the next month or so and for the rest of the year – I think homeowners are just trying to get in before that happens,” said Lee.

Some economists were surprised at the December gain of 18.8 percent because the period included rising Omicron cases and an uptick in mortgage rates.

“It’s starting to baffle us,” said Peter Morici, the former director of the Office of Economics at the U.S. International Trade Commission and a professor at the University of Maryland. “It’s one thing for people to be flush with stimulus cash and go out and buy a new stove or refrigerator. A mortgage is a long-term commitment.”

Hot markets like Phoenix, Tampa and Miami are still seeing strong price growth– Phoenix, for example, saw a 1.3.% increase compared to a 1.2% increase the month prior. Remote work has driven demand for warmer climates and more space, though all 20 cities in the composite are at their all-time highs for prices.

Inventory remained a serious problem for the housing market. Buyers in December had about half the selection of buyers two years ago.