By MARTIN CRUTSINGER, AP Economics Writer

WASHINGTON (AP) — The U.S. economy in the third quarter grew at the fastest pace in two years, with a revised report showing stronger consumer spending than first estimated.

The gross domestic product, the country's total output of goods and services, expanded at an annual rate of 3.2 percent in the July-September period, the Commerce Department reported Tuesday. That is up from a previous estimate of 2.9 percent.

The revision was significantly better than the meager gains of 0.8 percent in the first quarter and 1.4 percent in the second quarter when the economy was being held back by a strong dollar and weak business investment.

The 3.2 percent increase was expected to be the best showing for the year. Economists believe growth has slowed to around 2 percent in the current quarter. At the moment, they forecast growth of around 2 percent to 2.5 percent for 2017.

But analysts caution that the outlook for next year could shift significantly based on policy changes — such as tax cuts and higher trade tariffs — that President-elect Donald Trump has promised to implement.

"Uncertainty regarding our forecasts is higher than usual given expected fiscal and trade policy changes under the new administration," said Barclays economist Blerina Uruci.

The latest look at GDP, the second of three estimates from the government, showed that consumer spending grew at a 2.8 percent rate in the third quarter, better than the 2.1 percent advance first estimated. The new-found strength reflected more spending than initially thought in such areas as auto purchases and utility bills. Still, consumer spending, which accounts for 70 percent of economic activity, slowed from a gain of 4.3 percent in the second quarter.

Other areas of strength were in export sales, which grew at a 10.1 percent rate. Although the figure partially reflected a temporary surge in exports of soybeans, economists are hopeful that exports will show further gains in the months ahead. Earlier in the year, American manufacturers were battered by a strong dollar which made their goods more expensive on overseas markets.

The 3.2 percent GDP gain, the best showing since a 5 percent advance in the third quarter of 2014, is not expected to last. Analysts believe growth will slow to a still-solid 2 percent rate in the current quarter as a temporary boost from business restocking of store shelves fades. The swing in inventories added 0.5 percentage point to growth in the third quarter, while the improvement in trade added 0.9 percentage point to growth.

For the year, the economy is expected to grow a modest 1.5 percent, down from 2.6 percent growth in 2015 — the best performance in the seven years since the Great Recession ended in mid-2009.

While GDP growth is expected to slow, analysts still expect the Federal Reserve to boost a key interest rate at their meeting later this month. It would mark the first rate hike since the Fed boosted its benchmark rate by a quarter-point a year ago.

During the recent campaign, Trump decried what he saw as a sluggish economic recovery under Obama, with GDP gains averaging around 2 percent since the end of the recession. Trump said he wanted to set a national goal of reaching 4 percent growth during his administration.

Most economists think that may be overly optimistic given the mass retirement of baby boomers, which would weaken growth in the labor market, and very tepid productivity growth.

Some economists have said they will boost their GDP forecasts if Trump is successful in getting Congress to pass his package of tax cuts and increased spending in such areas as defense and infrastructure projects. But their current estimates put growth at around 2.5 percent over the next two years, an improvement from their current forecast of growth next year of around 2 percent, but well below Trump's 4 percent target.

By major categories, business investment in new plants and equipment edged up at an annual rate of just 0.1 percent in the third quarter. This sector has been held back by steep cutbacks in spending by energy companies responding to the plunge in oil prices. Government spending increased a slight 0.2 percent as a gain at the federal level offset cutbacks at the state and local level.