The average long-term U.S. mortgage rate fell below 5 percent 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 percent from 5.3 percent last week, mortgage buyer Freddie Mac reported Thursday. A year ago, the rate was 2.77 percent.

The average rate on 15-year, fixed-rate mortgages, popular among those refinancing their homes, fell to 4.26 percent to from 4.58 percent 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 percent 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 percent in June compared with a year earlier.

Low mortgage rates helped fuel a surge in homebuying over the last two years, and many market observers have credited the rise in rates with driving enough buyers from the housing market to cool demand down from the frenzied levels seen in 2020, 2021 and early 2022.