WASHINGTON — Orders for long-lasting U.S. factory goods posted the biggest gain in nearly three years last month, pulled up by a surge in demand for civilian aircraft.

The Commerce Department said Thursday that orders for durable goods — which are meant to last at least three years — climbed 6.5 percent in June, reversing two straight monthly drops. The June increase was the biggest since July 2014.

Spending on durable goods accounts for a small part of American economic output. But changes in durable goods orders often signal where the economy is headed; so forecasters and investors watch the report closely.

While any uptick in orders is good news for the U.S. economy and for American manufacturers, the June numbers aren’t as impressive as they first appear.

The bulk of the increase came from a 131.2 percent surge in orders for civilian aircraft, a category that bounces around wildly from month to month. Excluding orders transportation equipment, which rose 19 percent overall, durable goods orders edged up just 0.2 percent last month.

Moreover, a number that is seen as a harbinger of future business investment — orders for capital goods, excluding military equipment and aircraft — slipped 0.1 percent in June.

U.S. industry has rebounded from a slump in late 2015 and early 2016, which was caused by cutbacks in the energy business and a strong dollar that makes U.S. goods costlier in foreign markets. The Institute for Supply Management, a trade group of purchasing managers, said that its manufacturing index rose last month to the highest level since August 2014.