Orders to U.S. factories managed a slight gain in July as a surge in demand for commercial aircraft helped offset widespread weakness in other areas.

Factory orders edged up 0.1 percent, the first increase after two months of declines, the Commerce Department reported Thursday. But the strength came in the volatile transportation sector. Excluding transportation, orders were down 1.5 percent, the biggest drop in this category in 16 months.

Manufacturing has been the standout performer so far in this recovery with American companies benefiting from stronger growth in China and other developing nations, which has helped offset sluggish U.S. consumer demand.

Concerns that manufacturing could be faltering were eased on Wednesday with a report from the Institute for Supply Management showing that its closely watched gauge of manufacturing activity posted a stronger-than-expected reading of 56.3 in August. Additionally, a manufacturing index for China also showed a solid gain and car sales in that country surged.

The Chinese activity was seen as encouraging for the global economy given that China is now the world's second biggest economy. Rapid growth in China has provided a market for U.S. and other foreign manufacturers.

The small rise in U.S. factory orders reflected an increase of 0.4 percent in demand for durable goods, products expected to last at least three years. That represented a slight upward revision from a preliminary report last week showing durable goods up 0.3 percent in July.

In addition to the 0.1 percent rise in total factory orders in July, the government revised the June figure to show a smaller 0.6 percent decline, just half the 1.2 percent drop originally reported. Government analysts said much of that revision reflected greater strength in machinery orders than initially estimated.

Theresa Chen, an economist at Barclays Capital, wrote in a research note that she is expecting slower growth in both orders and factory shipments in the July-to-September quarter compared to the more rapid increases that occurred in the second quarter.

Demand for nondurable goods, products from food to chemicals and clothing, were unchanged in July after a 1.1 percent drop in June.

The strength in durable goods came from a 12.9 percent rise in transportation orders as demand for commercial aircraft soared 75.9 percent. Orders for motor vehicles and parts rose 3.7 percent.

However, there were widespread declines in other categories. Orders for iron and steel were down 0.5 percent and demand for heavy machinery fell 13.6 percent.

Orders for computers dropped 18.2 percent while demand for nondefense communications equipment fell 1.4 percent and demand for furniture was off 4.7 percent, likely a reflection of the renewed weakness in housing sales.

In one troubling sign, orders for nondefense capital goods excluding aircraft, considered a good proxy for business investment plans, fell 7.2 percent in July after a gain of 3.6 percent in June.