Prices for new single family homes rose to a five-month high in June even as sales slipped, but recovery for the broader housing market continues to be frustrated by an oversupply of properties.

The Commerce Department said on Tuesday the median sales price for a new home increased 5.8 percent last month to $235,200. Compared to June of last year, prices rose 7.2 percent.

Indications that home prices were starting to stabilize were also evident in the S&P/Case Shiller survey, whose composite index of prices in 20 metropolitan areas was flat in May after a 0.4 percent gain in April.

Analysts, however, said firming prices would likely be short-lived given the huge supply of homes on the market.

Sales are the key and the surge turns into a torrent only if the sales firm or much more time passes, said Michael Montgomery, a U.S. economist at IHS Global Insight in Lexington, Massachusetts.

New home sales fell 1 percent to an annual rate of 312,000 units in June. A report last week showed sales of previously-owned homes fell to a seven-month low in June, but average prices rose 0.8 percent to $184,300 from a year ago.

SPRING FLUKE?

We have been expecting an increase in home prices in the spring as distressed sales become a smaller share of activity amid a seasonal pick-up in voluntary sales, said Michelle Meyer, a senior U.S. economist at Bank of America Merrill Lynch in New York. This will likely reverse in the winter, dragging down prices again.

A glut of homes for sale as the economy struggles with a 9.2 percent unemployment rate is weighing on the housing market. There were about 3.77 million used homes on the market in June, plus properties in foreclosure.

The housing market is just one trouble spot for an economy that has been trapped in a soft patch since the beginning of the year.

But there is also hope U.S. economic growth will regain momentum in the second half of the year, and other data on Tuesday showed consumers grew more optimistic about the future this month.

The Conference Board's index of consumer attitudes rose to 59.5 from 57.6 in June, beating economists' expectations for a reading of 56.0.

Still, confidence remains at low levels and consumers grew less optimistic about current conditions. Confidence could be shattered if the U.S. Congress fails to raise the country's borrowing limit, which could trigger a debt default and downgrade of the United States' coveted triple-A credit rating.

The stalemate in debt talks pushed down Wall Street stocks for a second straight day and drove the dollar downward against a basket of currencies. But prices for U.S. government debt rose as investors still regard Treasuries as one of the lowest-risk investments out there.

COMPANIES WORRIED

U.S. corporations are concerned about the recovery, which has struggled to gain momentum after the 2007-09 recession with the drag of high unemployment and slack demand.

United Parcel Service Inc, the world's largest package delivery company, gave a cautious outlook and cited the stalled debt talks as a threat to confidence.

Ford Motor Co, announcing profits that topped Wall Street expectations, said it now sees U.S. sales for the full year at the bottom end of its previous forecast of 13 million to 13.5 million vehicles.

The government is expected to report on Friday the economy grew at a 1.8 percent annual rate, according to a Reuters survey, after a tepid 1.9 percent pace in the first three months of the year.

A Reuters survey of economists put the prospect of a new recession at one in five, and 38 of the 54 economists polled said they expected the United States would lose its triple-A debt rating from at least one ratings agency.

(Additional reporting by Leah Schnurr in New York, Editing by Neil Stempleman, Gary Crosse)