Sales of previously occupied U.S. homes slowed in June, but a key measure of home prices climbed to an all-time high, adding to affordability challenges for prospective homebuyers.

Existing home sales fell 2.4% last month from May to a seasonally adjusted annual rate of 4.09 million units, the National Association of Realtors said Thursday. Sales rose 2.8% compared with June last year.

The latest sales tally fell short of the roughly 4.21 million pace economists were expecting, according to FactSet.

Home sales have been mostly hovering close to a 4-million annual pace going back to 2023, far short of the historic norm that is closer to 5.2-million.

Sales have remained sluggish as mortgage rates have mostly trended higher in the months since the war between the U.S. and Iran started. Expectations of higher inflation amid surging oil prices have pushed up the long-term bond yields that lenders use as a guide to pricing home loans, causing mortgage rates to climb. Still, mortgage rates remain below where they were a year ago.