The U.S. economy grew at a solid annual rate of 3.5 percent in the July-September quarter, propelled by solid gains in business investment, export sales and the biggest jump in military spending in five years.

The third quarter result, which was slightly better than economists expected, followed a 4.6 percent rebound in the second quarter, the Commerce Department reported Thursday. The economy shrank at a 2.1 percent rate in the first three months of the year due to a harsh winter.

The report was the first of three estimates of the gross domestic product, the economy's total output of goods and services. Analysts believe the economy is maintaining momentum in the current quarter, with a big fall in gas prices expected to bolster consumer spending. After the roller-coaster first- and second-quarter gyrations, the economy is poised to achieve consistently stronger growth for the rest of this year and all of 2015.

"The economy does appear to be accelerating of late," said Dan Greenhaus, an analyst with investment firm BTIG. He added that the GDP report showed an economy "on a sounder footing today than at any time over the last few years."

Many economists think full-year growth for 2015 will hit 3 percent, giving the economy the best annual performance since 2005, two years before the Great Recession began.

For the third quarter, consumer spending grew at a solid 1.8 percent annual rate. That was slower than the 2.5 percent increase in the spring quarter, a gain that reflected pent-up demand as consumers made up for missed shopping days during the winter storms.

Consumer spending contributed 1.2 percentage points to growth in the third quarter. Another major contribution came from an 11 percent rise in export sales, far outpacing imports, which fell at a 1.7 rate. The smaller trade gap added 1.3 percentage points to growth in the third quarter.

The data comes amid concern that the export boom may soon fade due to weakness overseas. Europe is on the brink of its third recession in seven years, Japan is faltering, and China and Brazil are also struggling.

Stronger government spending added another 0.8 percentage point to growth, with federal spending growing at a 10 percent rate. It was the first positive contribution in more than two years. Federal activity had been constrained by spending cuts and last year's partial government shutdown.

Defense spending shot up at a 16 percent rate, the fastest advance since a 17.4 percent gain in the second quarter of 2009.

Business spending on equipment grew at a 7.2 percent rate in the third quarter, and residential construction grew at a 1.8 percent rate. While an increase, it marked a slowdown from 8.8 percent growth in housing in the second quarter.

Much of the optimism for the economy going forward stems from the strength of job growth, which has lowered the unemployment rate to a six-year low of 5.9 percent. In September, the economy added 248,000 jobs, extending a string of strong gains.

The additional workers should translate into more income and consumer spending, which accounts for 70 percent of economic activity.

The Federal Reserve noted the brightening U.S. prospects as it ended a policy meeting Wednesday. It retained language in a statement saying it didn't expect to raise its benchmark interest rate for a "considerable time." But it also pointed to rising signs of strength, including job gains and lower unemployment.

Against that backdrop, the Fed ended its third round of bond buying. Over the past six years, the Fed has pumped more than $3 trillion into the economy through bond purchases designed to keep long-term rates low.

Paul Ashworth, chief U.S. economist at Capital Economics, said that the solid GDP report showed "the Fed was right to take a slightly more hawkish tone."