(Sharecast News) - Existing home sales in the United States unexpectedly declined in June, according to the National Association of Realtors, though home prices soared as affordability trends picked up.

The number of existing homes sold last month totalled 4.09m, down 2.4% over the month before, pulling back after a 3.7% gain in May. The consensus estimate was for a small rise to 4.2m from May's 4.19m.

Nevertheless, the median existing-home sale price rose to an all-time high of $440,600 in June, marking a 2% increase from a year before and three straight years of monthly home price increases.

Elevated home prices and mortgage rates may have prompted prospective buyers to "rethink their budgets", the NAR said in a report.

"The back-and-forth in monthly home sales activity, driven by mild fluctuations in mortgage rates, shows how sensitive home buyers are to affordability conditions," says Lawrence Yun, NAR's chief economist.

"However, job gains - more than half a million since the beginning of the year - will continue to provide support for the housing market."

Despite the jump in prices, affordability levels are improving, the NAR said, with its housing affordability index showing annual improvements of 8.9% in the West, 8.3% in the South, 6.2% in the Midwest and 4.5% in the Northeast.

Meanwhile, the 30-year fixed-rate mortgage averaged 6.49% for June, down from 6.82% a year earlier, according to data from Freddie Mac.

Nevertheless, Yun warned that, without consistent increases in inventory levels, home price inflation could accelerate.

"It is critical to introduce more supply to the market to widen the opportunity for homeownership," he said.