Sales of new single-family U.S. homes unexpectedly rose in July and new orders for durable goods posted strong gains that underlined the economy's strength just before a credit crisis socked financial markets.

New home sales rose 2.8 percent to an 870,000 annual pace last month, reversing two months of declines, and inventories eased, a Commerce Department report showed on Friday.

Analysts were expecting new home sales to dip to an 820,000 sales pace. Home sales in June were revised to an annual rate of 846,000 from the previously reported 834,000 rate.

It's unexpectedly firm. So combined with durable goods data, this suggests that the economy was fairly sturdy heading into the market disruption in August, said Pierre Ellis, senior global economist at Decision Economics in New York.

An earlier Commerce Department report showed new orders for long-lasting U.S.-made manufactured goods surged a much bigger-than-expected 5.9 percent in July, the biggest gain since September, and a business investment gauge posted the first gain in three months.

Analysts were expecting orders of durable goods, which are meant to last three years or more, to rise 1 percent. Non-defense capital goods orders excluding aircraft, viewed as an indicator of business spending, gained 2.2 percent, the steepest climb since March.

Stocks were slightly higher after the reports. Treasury debt prices were higher and the dollar was lower against the yen and the euro. However, analysts cautioned the data reflect activity prior to August's financial market turmoil over subprime mortgage loan delinquencies.

It doesn't reflect the impact of the recent financial crisis, Hugh Johnson, chief investment officer at Johnson Illington Advisors in Albany, New York, said of the durables report.

Excluding volatile transportation orders, durables orders jumped 3.7 percent in July, the sharpest rise since August 2005 and the first rise in that category since April. When defense orders were stripped out, durables orders advanced 4.9 percent, the strongest increase since March.

Analysts were expecting an 0.6 gain in durables orders ex-transportation and a 0.5 percent advance in durables orders ex-defense.

Transportation equipment orders rose 10.8 percent. Civilian and defense aircraft orders advanced by 12.6 percent and 15.8 percent respectively, while orders for cars, trucks and parts advanced 9.8 percent.

Orders for computers and electronic products and machinery posted their sharpest gains since November 2006.

Meanwhile, the supply of homes available for sale eased to a seasonally adjusted 533,000, the lowest since January 2006, the Commerce Department said. That represents a 7.5 months' supply of homes available at the current sales pace.

The supply of new homes available for sale is down 7 percent from July 2006, the biggest 12-month drop since January 1998.

The median sales price rose to $239,500 in July from $230,600 in June. That was down 3.4 percent from the same month a year earlier, the biggest 12-month decline since October 2001.