Prices of U.S. single-family homes rose for the second consecutive month in June, exceeding expectations and adding to evidence that the three-year housing slump is easing, Standard & Poor's reported on Tuesday.

The S&P/Case-Shiller composite indexes of 10 and 20 metropolitan areas both rose 1.4 percent in June from May, almost three times the 0.5 percent increases of the month before. May's increases were the first in nearly three years.

Optimism over a housing recovery blossomed last week after reports showed rising confidence among homebuilder and sales of existing homes rose in July for the fourth consecutive month. Economists expect the sector's recovery could help the nation emerge from recession and further stabilize financial markets that have suffered their worst crisis since the 1930s.

The 10- and 20-city indexes have dropped 54.3 percent and 45.3 percent from their 2006 peaks, respectively. Economists expected the 20-city index increased by 0.2 percent in June.

This is just another month that supports those that think we have bottomed, or are nearing a bottom, said Jesse Litvak, a managing director at Jefferies & Co. in Stamford, Connecticut.

Stocks rose, with the Dow Jones U.S. Home Construction Index gaining 3.6 percent and beating major averages.

The increases come after a period of dizzying home price drops through the fourth quarter of 2008 and early 2009.

Banks and mortgage servicing companies during the time accelerated sales of foreclosed properties, some done in bulk, forcing prices lower during a typically softer selling season, said Thomas Lawler, founder of Lawler Economic & Housing Consulting in Leesburg, Virginia.

Stability in home prices also likely reflects government programs instituted this year, said Ronald Temple, a portfolio manager at Lazard Asset Management in New York.

Mortgage servicing companies are under pressure to slow foreclosures through President Barack Obama's Making Home Affordable plan, which aims to ease refinancings or modify existing loans to cut payments. A Federal Reserve program of lowering mortgage rates through securities purchases sharply reduced home loan rates in the first and second quarters.

But the average 30-year mortgage rate has edged about a half-percentage point higher from its March low of 4.61 percent, erasing some of that help to borrowers.

What we expect to see for the next two months is that the government's efforts to reduce supply are working, and efforts of the Federal Reserve to increase demand through lower mortgage rates are also working, Temple said.

We think there is some more downside once markets fully reflect those efforts, he said.

Foreclosure filing activity in July rose to a record pace for the third month in five, worrying economists about a huge shadow inventory that could soon hit the market. More than 360,000 borrowers received a foreclosure filing last month, the most since real estate firm RealtyTrac began collecting the data in January 2005.

Sales of foreclosed homes tend to attract lower bids from buyers and reinforce the cycle of home price drops that erase homeowners' equity, encouraging defaults.

The real risk is if lenders and servicers display the same behavior they did during the seasonally weak period, Lawler said. Will a smaller share result in (bank-owned properties) because of enhanced loss mitigation and short sale activity?

S&P said its U.S. National Home Price Index recorded a 14.9 percent decline for the second quarter, compared with a 19.1 percent year-over-year drop in the first quarter. Versus the first quarter, prices rose by 2.9 percent in the first such increase in three years, S&P said.

Regionally, only Las Vegas and Detroit posted declines in June over May, of 2 percent and 0.8 percent, respectively. Cleveland home prices registered the greatest increases for the past two months, topping 4 percent each time, likely bouncing back from the effects of bank sales, said economist Lawler.

(Editing by W Simon)