U.S. home sales tumbled 1.7% in June, with rising prices and a scarce supply locking out many Americans from ownership.

The National Association of Realtors said Tuesday that homes were sold last month at a seasonally adjusted annualized rate of 5.27 million units. Sales have shriveled 2.2% over the past 12 months, despite such positive trends as a robust job market and falling mortgage rates.

But home prices have been climbing faster than incomes for the past seven years. This persistent gap has left many renters unable to afford ownership and prevented existing owners from upgrading to pricier properties. There has also been a supply shortage: Sales listings were flat over the past year at 1.93 million units.

The median sales price climbed 4.3% from a year ago to $285,700, outpacing wage growth that has averaged roughly 3%.

In June, sales fell in the South and West. But increases in home-buying in the Northeast and Midwest were insufficient to offset the decline.

There has been a persistent lack of homes on the market priced below $250,000, a level close to the median national price. But over the past year in the more expensive Northeast and West markets, sales of homes priced at more than $750,000 have fallen — a sign that home values are too high relative to people's incomes.

There was an increase in the proportion of first-time buyers in June to 35%, up from 32% in May. But home ownership rates for Americans today between the ages of 25 to 34 are lower than preceding generations, according to Census Bureau data.

Homes that are listed are selling quickly — with a contract being signed in just 27 days.