(NerdWallet) – Mortgage rates are likely to rise in July, extending a seven-month streak.

The same factors may push them even higher in July and over the next few months. Rates will stop climbing someday — but probably not this summer or fall.

Inflation is behind rising rates

Higher interest rates tend to accompany high inflation, and prices have been rising at above an 8% annual rate for three months in a row. The Consumer Price Index stood at 8.6% in May (the most recent data available).

The price of money goes up at times of high inflation, just as the prices of bacon and eggs do. The higher price of money shows up in the form of higher interest rates. To earn a profit, lenders raise rates on all types of loans, including mortgages.

As long as inflation remains elevated, mortgage rates are likely to rise. Look for that to be the case in July.

The Fed’s role in higher rates

As lenders raise interest rates to stay profitable, the Federal Reserve pushes interest rates higher, too. But the Fed is a governmental body, so it hasn’t been increasing rates in search of corporate profits. Instead, it’s trying to pull the inflation rate lower.

When it costs more to borrow, consumers spend less money, easing inflationary pressures. That’s why the Fed is raising interest rates.

The Fed has raised the short-term federal funds rate 1.5 percentage points so far this year, and members of the rate-setting committee indicated that they expect to raise it at least 1.5 more percentage points by the end of 2022. In fact, they may go another 1.75 or 2 percentage points.

Although the Fed’s rate-raising campaign hasn’t yet pushed the inflation rate lower, the rate policy has yielded intended results in other ways. Household spending slowed way down in May, according to the Bureau of Economic Analysis. Spending was up 0.2% in May, compared to 0.6% in April.

And fewer people are buying homes. That’s an indirect goal of the Fed’s, because when the housing market cools, home prices won’t rise as fast.

An abrupt slowdown

Fewer people are buying homes because rising mortgage rates and prices make housing less affordable. Sales slowed down dramatically when mortgage rates headed steeply uphill.

As home sales slow, the number of homes on the market accumulates. In the week ending June 25, there were 25% more houses on the market compared to the same week a year earlier, according to Realtor.com data. Emphasizing this turn in the market, the number of price reductions on listed homes nearly doubled over the same period.

If the housing slowdown turns into a downright downturn, it’s possible that lenders could cut mortgage rates to win the business of fewer borrowers — to earn the same size slice from a shrunken pie. If the forecast for higher mortgage rates in July turns out wrong, this is the most likely reason: a collapse in home sales leading to a price competition among mortgage lenders.

What happened in June

The average rate on the 30-year fixed-rate mortgage averaged 5.66% in June, compared to an average of 5.32% in May. The monthly average rate has gone up every month since November.

At the beginning of June, I predicted that mortgage rates would be volatile and that the average rate on the 30-year fixed would be higher in the final week of June than in the final week of May. Both predictions were correct. I’ve predicted correctly five months in a row, and nine of the last 12.