The average price of homes bought with mortgages funded by Freddie Mac rose 1.7% during the second quarter, and for the first time in two years there were gains in every part of the United States.

The quarterly gain followed a 1.5% first-quarter drop, according to a report Freddie Mac released Tuesday. Compared with a year earlier, home prices fell 6.7%, slower than the first quarter's 8.5% annual decline.

Demand is returning to the U.S. housing market after a three-year slump cut values nationwide and led to record foreclosures. The number of contracts to buy previously owned homes rose more than forecast in July and increased for a record sixth consecutive month, reinforcing signs that the housing market is steadying.

"The pickup in home price growth rates is consistent with other housing market indicators that show home sales and single-family construction up in the second quarter," Frank Nothaft, Freddie Mac's chief economist, said in a press release.

The index of signed purchase agreements, or pending home sales, gained 3.2% after a 3.6% rise in June, the National Association of Realtors said Tuesday. The index level of 97.6 was the highest since June 2007.

Freddie Mac said values in most of the country still remain at 2004 levels.

Subscribe Now

Access to authoritative analysis and perspective and our data-driven report series.

14-Day Free Trial

No credit card required. Complete access to articles, breaking news and industry data.