Home prices in the US climbed for a fifth month as buyers competed for deals in the least affordable market in decades.

A national gauge of prices rose 0.7% in June from May, according to seasonally adjusted data from S&P CoreLogic Case-Shiller.

While rising mortgage rates have pushed some would-be homebuyers to the sidelines, there’s still plenty of demand from determined shoppers, who are left to battle over a severely limited inventory of listings. Elevated prices spurred by the supply crunch and higher borrowing costs have combined to make this the most-unaffordable housing market since 1984, according to Black Knight Inc.

The average 30-year mortgage rate reached 6.79% in early June, according to data from Freddie Mac. It has since jumped to 7.23%, further squeezing buyers.

“We recognize that the market’s gains could be truncated by increases in mortgage rates or by general economic weakness, but the breadth and strength of this month’s report are consistent with an optimistic view of future results,” Craig Lazzara, managing director at S&P Dow Jones Indices, said in a statement Tuesday.

On a year-over year basis, home prices nationally were flat. More recent data from Redfin Corp. showed values for the four weeks through Aug. 6 climbed 3% from the same period in 2022.

Chicago, Cleveland and New York posted the biggest year-over-year gains of a 20-city measure in June. Some of the worst-performing cities included Seattle, where prices fell 8.8% from a year earlier, and San Francisco, where prices dropped 9.7%.

This article was provided by Bloomberg News.