Updated from 12:06 p.m. EDT

New data released Tuesday suggest the U.S. housing market may have bottomed in June, prompting, in part, investors to bid up shares in mortgage giants Fannie Mae ( FNM) and Freddie Mac ( FRE).

The Census Bureau said sales of newly constructed homes totaled an annual rate of 515,000 in July, which was slightly lower than the consensus economist estimate of 525,000, according to Briefing.com.

The July results showed an improvement over the previous month's data. The June sales level was revised down to 503,000, from 530,000.

"While June could prove to be a bottom in sales, it will be difficult to definitively call before we move through the volatile winter selling months," Wachovia economic analyst Adam York said in a research note.

"Sales activity actually improved in the hard hit Western region, as builders attempted to work off new supply," York said.

The Census Bureau also reported that new-home inventory across the U.S. totaled 10.1 months of supply at the end of July, down from 10.7 months in June.

Fannie Mae surged 9% to $5.66, and Freddie Mac jumped 19% to $3.92 in recent trading Tuesday.

Shares of the two mortgage giants were also helped by a presentation from analysts at Citigroup who said the companies have enough capital to cover potential losses through the end of the year, according to Reuters, which obtained the presentation.

Homebuilders inititally rose slightly on the housing data news late morning; however, lately they were down. D.R. Horton ( DHI), Toll Brothers ( TOL) and the SPDR S&P Homebuilders ( XHB) were each losing some 2%.

Also on Tuesday, data from S&P/Case-Shiller showed home prices in the second quarter fell 15.4% from a year ago.

Prices in the top 20 U.S. cities fell 15.8% from last year's quarter.

The report says that housing market prices peaked in the June-July period of 2006. Since then, prices in the top 20 cities have fallen 18.8%.

Las Vegas remains the weakest market, with a 28.6% annual decline in prices in the second quarter.