Total output by U.S. manufacturing, mining and utilities industries posted an unexpected gain in July, boosted by increased car production, the Federal Reserve said Thursday.

The Fed said industrial production rose 0.2 percent, after a revised gain of 0.7 percent in June. But excluding output of motor vehicles and parts, overall production was off by 0.1 percent in the month.

Businesses also operated at a slightly closer level to their full capacities in July, the Fed said. Capacity in use hit 76.1 percent from June's 76.0 percent, the highest level since August 2001.

Manufacturing production, which makes up the largest share of overall industrial production, eked out a 0.1 percent rise. Mining activity fell by 1.2 percent, while utilities output surged 2.3 percent.

Analysts polled by Reuters had expected July output to fall by 0.1 percent, with capacity use forecast at 76.0 percent.