A key category of orders to U.S. businesses that tracks investment posted a small gain in June after two months of declines.

But overall factory orders fell, reflecting a drop in the volatile category of commercial aircraft.

The Commerce Department says that orders that cover business investment plans rose 0.4 percent in June following declines of 0.6 percent in May and 0.9 percent in April. Overall orders dropped 1.5 percent following a 1.2 percent fall in May. It was the biggest setback for total factory orders since a 1.9 percent decline in February.

Manufacturing has struggled over the past year as weakness in the global economy and a strong dollar have hurt export sales and business investment has been crimped by the big drop in energy prices.