(Adds details, analyst comments, updates markets)
* New home sales fall 9.4 percent in July
* May, June home sales revised higher
* Median new house price increases 6.3 percent from year ago
WASHINGTON, Aug 23 (Reuters) - New U.S. single-family home sales unexpectedly fell in July, dropping to their lowest in seven months amid a surge in prices, raising concerns of a slowdown in the housing market recovery.
Coming on the heels of data this month showing a tumble in home building and permits in July, the weak sales pace suggests that housing could remain a drag on economic growth in the third quarter.
"The third-quarter sales data are starting out significantly below the second-quarter average, and many other housing reports have also shown some recent weakening in their respective trends," said Daniel Silver, an economist at JPMorgan in New York. "Today's report strengthens our conviction that real residential investment will decline in the third quarter."
The Commerce Department said on Wednesday new home sales declined 9.4 percent to a seasonally adjusted annual rate of 571,000 units last month, the lowest level since December 2016. The percentage drop was the largest since August 2016 and confounded economists' expectations for a 0.3 percent gain.
June's sales pace was revised up to 630,000 units from the previously reported 610,000 units. Home sales in May also were not as weak as previously reported, taking some of the sting from July's report.
New home sales, which account for 9.4 percent of overall housing sales, are volatile month-to-month and are drawn from building permits. Still, sales declined 8.9 percent on a year-on-year basis, the first annual drop since February 2016.
July's sales pace was below the second-quarter average of 613,000 units. Sales fell in the Northeast, South and West, but rose in the Midwest. In a separate report on Wednesday, the Mortgage Bankers Association said applications for loans to buy a house decreased last week to a six-month low.
A survey last month by Fannie Mae, the largest U.S. mortgage guarantor, showed a drop in the share of respondents saying now is a good time to buy a home as well as a surge in the number of those who believe this is a bad time to buy.
Housing subtracted nearly three-tenths of a percentage point from gross domestic product in the second quarter.
U.S. financial markets were little moved by the data as investors worried over comments by President Donald Trump threatening a government shutdown to secure funding for a border wall with Mexico, raising the specter of a tough budget battle.
Trump also said late on Tuesday he might terminate the NAFTA trade treaty with Mexico and Canada after three-way talks failed to bridge deep differences.
The PHLX index of housing stocks fell in line with a broadly weaker U.S. stock market. Shares in the nation's largest homebuilder, D.R. Horton, slipped 0.22 percent and Lennar Corp fell 0.28 percent.
Pultegroup stock declined 0.43 percent. The dollar was trading lower against a basket of currencies, while prices for U.S. Treasuries rose.
Despite the drop in new home sales, the housing market remains underpinned by a strong labor market, which is near full employment. But it is being hampered by a shortage of homes, which is driving up prices.
Contributing to the dearth of homes on the market, some homeowners are remodeling their houses rather than trading up.
Those renovations are boosting business for home improvement retailers like Lowe's Companies, which on Wednesday reported a 6.8 percent increase in net sales in the quarter ended Aug. 4.
The median price of a new home increased 6.3 percent in July from a year ago to $313,700. In contrast, annual wage growth has struggled to break above 2.5 percent.
Despite the acute housing shortage, builders are struggling to fill the void, citing supply constraints, including labor, land and finance. Last month, 70 percent of the new single family homes sold were either yet to be built or under construction in July.
"New home sales are still concentrated in the higher end of the market," said Matthew Pointon, an economist at Capital Economics in New York. "Until builders switch their efforts to cheaper starter homes that will limit to degree to which sales can grow."
The inventory of new homes on the market rose 1.5 percent to 276,000 units last month, the highest level since June 2009. Still, new housing stock is less than half of what it was at its zenith during the housing bubble.
At July's sales pace it would take 5.8 months to clear the supply of houses on the market, almost a two-year high and up from 5.2 months in June.
(Reporting by Lucia Mutikani; Editing by Andrea Ricci)