Homebuyers are pulling back, and prices are finally following.

Home prices are still rising, but the gains are shrinking. In June, prices nationally rose 6.2 percent year over year, according to the S&P CoreLogic Case-Shiller Indices. That is down from the 6.4 percent annual gain in May.

Home prices in the nation's 10 largest housing markets rose 6 percent annually, down from 6.2 percent in the previous month. In the 20 largest markets, prices were up 6.3 percent, down from 6.5 percent in May.

"Even as home prices keep climbing, we are seeing signs that growth is easing in the housing market," said David Blitzer, managing director and chairman of the index committee at S&P Dow Jones Indices, in a release. "Sales of both new and existing homes are roughly flat over the last six months amidst news stories of an increase in the number of homes for sale in some markets."

Rising mortgage rates are also taking their toll. The rate on the popular 30-year fixed mortgage rose from around 4 percent at the start of the year to just more than 4.5 percent now. That directly affects housing affordability.

Prices are still higher because of the shortage of homes for sale in general and particularly at the entry level of the market.

The supply of homes for sale in July was unchanged from a year ago, according to the National Association of Realtors. While it wasn't a gain, it was the first time it didn't show a negative annual reading in a few years. Builders still are not producing enough new entry-level homes to meet demand, and potential sellers are holding back, concerned they won't be able to find or afford a different home.

Home price gains are still quite strong in the West, where supplies are leanest, but those gains are shrinking as well. Las Vegas, Seattle and San Francisco continue to lead the pack in price rises. In June, Las Vegas led the way with a 13 percent year-over-year price increase, followed by Seattle with a 12.8 percent rise and San Francisco with a 10.7 percent increase. Six of the 20 cities reported greater price increases in the year ended in June 2018 versus the year ended in May 2018.

"Population and employment growth often drive homes prices," Blitzer said. "Las Vegas is among the fastest-growing U.S. cities based on both employment and population, with its unemployment rate dropping below the national average in the last year."

The Northeast and Midwest are seeing smaller home price increases, as prices there weren't quite as hot to begin with, and more supply is coming on the market. Some markets in the Northeast are also being hit by new tax laws. Washington, Chicago and New York showed the three slowest annual price gains among the 20 cities covered by the report.