U.S. single-family home prices rose in June though the pace of gains slowed slightly, a closely watched survey showed on Tuesday.

The S&P/Case Shiller composite index of 20 metropolitan areas rose 0.9 percent on a seasonally adjusted basis, just shy of economists' forecast for a 1 percent increase. Prices rose 1 percent in May.

On a non-adjusted basis, prices rose 2.2 percent.

Compared to a year earlier, prices were up 12.1 percent, in line with economists' expectations. Prices were up 12.2 percent in the year to May, the biggest gain in more than seven years.

The report suggested the housing sector continues to recover despite a recent rise in mortgage costs. Economists have pointed to a stronger housing market as a bright spot in the U.S. economic rebound.

Prices in all 20 cities rose on a yearly basis, led by a 24.9 percent surge in Las Vegas and followed closely by a 24.5 percent gain in San Francisco.