The U.S. economy surged in the first quarter, a report showed Friday, as activity resumed even following the stock-market rout in late 2018 and President Donald Trump's 35-day federal-government shutdown, the longest in history.

Gross domestic product climbed by 3.2%, the Commerce Department's Bureau of Economic Analysis said in a report. The growth rate was 2.2% in the fourth quarter.   

Economists surveyed by data provider FactSet had projected a first quarter clip of 2%, on average. 

The report represents a remarkable turnaround for the U.S. economy, which appeared headed toward a major slowdown as recently as March. 

It's also a coup for Trump, whose top economic officials promised that the $1.5 trillion of tax cuts in late 2017 would lead to 3% annual growth rates. A report earlier this year showed that the economy expanded at a 2.9% rate in 2018, fast enough for the officials to claim that the president's policies were working.

The March GDP report should make "clear that the market narrative of an imminent recession during the quarter was simply wrong," said Eric Winograd, senior U.S. economist for the $555 billion money manager AllianceBernstein.

The current economic expansion, which began in 2009, is already the second-longest in U.S. history and would surpass the record of 120 months if it continues through July. 

"First-quarter GDP growth is one of the great comeback stories of the year," said Michael Reynolds, investment-strategy officer at the money manager Glenmede, in an e-mail. "We started 2019 with fears that the longest government shutdown in history, along with a softening global growth outlook, would weigh on economic activity in the first quarter. But 3.2% growth is a solid result, suggesting this long, late-stage expansion may be more resilient than feared."

Economists quickly cautioned that several factors contributing to the first quarter's surprising success may not be repeatable. 

The reported growth rate reflected higher business inventories, state and local government spending and exports, partly offset by a slowdown in personal spending, business investment and federal-government spending, according to the bureau. 

David Berson, chief economist at Nationwide, wrote in an e-mail that final sales to domestic purchasers, his preferred measure of underlying growth, increased by just 1.2%. 

"Inventories jumped, and the pace of increase is unsustainable," Berson wrote. "Government spending jumped, something that is also unlikely to continue."

Businesses are expected to work down elevated inventories in future periods, while the U.S. trade balance probably will return to a deficit, said Steve Blitz, chief U.S. economist for the forecasting firm TS Lombard.

"Beyond the headline number, when I look at this report, I see nothing that tells me that growth momentum is going up," Blitz said. "It sets us up for a weak second quarter."

The economy is currently seen as expanding at a 2.6% clip in the second quarter, and 2.4% for the year, based on the FactSet survey, though both administration officials and some forecasters say a 3% clip as a realistic possibility for the full 2019.  

Yields on 10-year U.S. Treasuries fell 0.04 percentage point to 2.5% on Friday, indicating a dour assessment of the GDP report from bond traders.

The Standard & Poor's 500 Index of large U.S. stock slid 0.2% to 2,921.