Orders for U.S. manufactured items beat expectations in May, boosted by demand for machinery and computer products, the government said Wednesday in a fresh indication the sector hardest hit by the recession is recovering.

Factory orders climbed 0.7 percent in May to $321 billion, the Commerce Department said, after a matching 0.7 percent rise the prior month.

Analysts were expecting orders to rise 0.5 percent.

Machinery demand rose 2.1 percent while orders of computers and electronic products rose 0.6 percent. Non-defense capital goods excluding aircraft, a barometer of business investment seen as crucial to a strong recovery, rose 1.2 percent.

Inventories posted their 16th straight month of decline, dropping 0.4 percent, in a sign that factories may need to boost production to keep up with demand. Shipments edged up 0.2 percent.