Orders to U.S. factories posted a modest gain in July, helped by the biggest rise in motor vehicles orders in a year and a solid gain in a category that tracks business investment plans.

Factory orders rose 0.4 percent in July, the Commerce Department reported Wednesday. Orders had increased a much larger 2.2 percent in June.

The modest increase in factory orders in July suggests that manufacturing is still grappling with a variety of challenges, from falling energy prices to a stronger dollar, which hurts exports.

But a key category that tracks business investment plans climbed 2.1 percent, posting the strongest gain in 13 months.

For July, orders for motor vehicles surged 4 percent, the largest jump since July 2014.

Orders for durable goods, items expected to last at least three years like bicycles and battleships, increased 2.2 percent in July, slightly stronger than the 2 percent estimate the government made last week. Orders for nondurable goods such as chemicals and paper, fell 1.3 percent in July after a 0.4 percent rise in June.

Orders in the business investment category had fallen in four of the previous five months before June, reflecting the soft patch that manufacturing has faced this year.

U.S. manufacturers must contend with a number of headwinds including a sharp slowdown in growth in China, a strong dollar, which makes U.S. products more expensive in export markets, and falling oil prices, which have caused energy companies to cut back on their invest spending.

On Tuesday, the Institute for Supply Management reported that its manufacturing index slid to 51.1 last month from 52.7 in July. It was the second straight drop. Economists had been expecting the index to rebound modestly in August. Anything above 50 signals growth.