WASHINGTON (AP) — The average long-term U.S. mortgage rate fell below 5% for the first time in four months, days after the Federal Reserve jacked up its main borrowing rate in an aggressive effort to get inflation under control.

The 30-year rate tumbled to 4.99% from 5.3% last week, mortgage buyer Freddie Mac reported Thursday. A year ago, the rate was 2.77%.

The average rate on 15-year, fixed-rate mortgages, popular among those refinancing their homes, fell to 4.26% to from 4.58% last week.

“Mortgage rates remained volatile due to the tug of war between inflationary pressures and a clear slowdown in economic growth,” said Sam Khater, Freddie Mac’s chief economist. “The high uncertainty surrounding inflation and other factors will likely cause rates to remain variable, especially as the Federal Reserve attempts to navigate the current economic environment.”

Last week, the Fed ratcheted up its main borrowing rate by three-quarters of a point, the second such increase in less than two months. The central bank also raised its benchmark rate by a half-point in May, beginning its aggressive pivot to try to stifle four-decade high inflation.

Consumer prices have soared 9.1% over the past year, the biggest yearly increase since 1981. The Labor Department’s producer price index — which measures inflation before it reaches consumers — rose by 11.3% in June compared with a year earlier.

Rapidly hiking rates risks pushing the U.S. economy into a recession, but it’s the Fed’s most powerful tool to get price increases back to its 2% annual target.

The government reported last week that U.S. economy shrank from April through June for a second straight quarter, contracting at a 0.9% annual pace and raising fears that the nation may be approaching a recession.

The decline that the Commerce Department reported in the gross domestic product — the broadest gauge of the economy — followed a 1.6% annual drop from January through March. Consecutive quarters of falling GDP constitute one informal, though not definitive, indicator of a recession.

Higher borrowing rates have discouraged house hunters and cooled a housing market that’s been hot for years. The National Association of Realtors reported last month that sales of previously occupied U.S. homes slowed for the fifth consecutive month in June.

Home prices have kept climbing — albeit at a slower pace than earlier this year —- even as sales slowed. The national median home price jumped 13.4% in June from a year earlier to $416,000. That’s an all-time high according to data going back to 1999, NAR said.

Layoffs in the housing and lending sectors have already begun. Among those reporting job cuts in recent months are the online mortgage company loanDepot, online real estate broker Redfin, and Compass.

The nation’s largest bank by assets, JPMorgan Chase, laid off hundreds from its mortgage unit and reassigned hundreds of others.