The U.S. economy grew at its strongest pace in two years in the third quarter, according to government data released Friday morning, lifting hopes that the economy is finally recovering momentum after a long period of sustained weakness.

Between the months of July and September, the nation's gross domestic product expanded at an annualized rate of 2.9 percent, fast enough to create new jobs and pare down the unemployment rate, economists said. The reading surpassed expectations of economists surveyed by Bloomberg, who had forecast growth of 2.6 percent.

The data, which was released by the Commerce Department, showed the nation's economy bouncing back following months of stubbornly sluggish economic growth. Growth in GDP -- a broad measure of America's economic activity -- has remained below 2.7 percent for the previous seven quarters.

"It's a sigh of relief after just over barely 1 percent growth in the first half of the year," said Stuart Hoffman, chief economist at PNC.

The rebound was driven by a surge in American exports abroad, which rose 10 percent in the quarter, the biggest increase in nearly three years, due in part to exceptionally strong exports of soybeans to South America. Businesses also made new purchases to restock their inventories, after struggling to draw down on large stockpiles of goods in previous quarters.

Consumer spending, which accounts for about two-thirds of the U.S. economy and had buoyed growth in the spring, moderated somewhat into the summer.

The data comes a little more than a week before many Americans go to the polls in the presidential election. The strong figures could bolster Democratic candidate Hillary Clinton's case that the efforts of President Obama are helping to restore the U.S. economy. Yet the sluggish economic growth of the past few years is likely to leave Republican candidate Donald Trump plenty of room to continue to criticize Democratic policies.

The strong data, combined with an uptick in consumer inflation, also buoyed expectations for an interest rate hike in December. Inflation remains below the Federal Reserve's target rate of 2 percent, but it continues to creep closer to that level. However, few investors expect the rate-setting committee to make a move at its upcoming Nov. 1-2 meeting.

"On the margin, this report should support the argument that the economy could handle a very small rate of increase," said James Marple, director and senior economist at TD Economics.

Economists cautioned that the data is a preliminary reading and will be revised twice more over the coming months. These revisions can often give a substantially different picture of the economy.

The Commerce Department's data revealed a few sources of weakness in the U.S. economy. Construction of new houses and local government spending were sluggish, while American businesses still seemed hesitant to invest in new equipment.

However, the U.S. energy sector showed signs of once again contributing to economic growth after struggling for many quarters. A recent uptick in oil prices, from historic lows of below $30 a barrel earlier this year, shows signs of having boosted drilling, mining and energy production.

The stronger GDP number pulls up the average for this year, making the current state of the economy look a little rosier. But economists worried that this performance may not be sustained.

Ben Herzon, an economist at Macroeconomic Advisers, called the third quarter GDP figure "solid" but said it was "not a sign of persistent strength." Businesses that restocked inventories in the third quarter are unlikely to make as many purchases in the fourth quarter. And the surge in exports in this quarter is unlikely to be repeated, especially if the Fed decides to raise interest rates, a move which is likely to put upward pressure on an already-strong dollar.

As a result, the group expects economic growth to once again sink in the fourth quarter, falling to 1.6 percent. "While it's pretty good news for the third quarter, it's not as good for the fourth quarter," he said.

You might also like:

There's a devastatingly simple explanation for America's economic mess

Why the next president may have more power than usual

Striking new research on inequality: 'Whatever you thought, it's worse'