The numbers: Reports of the demise of the U.S. economy proved unfounded as first-quarter activity showed surprising strength. The U.S. economy expanded at a 3.2% annual pace in the first three months of 2019, the government said Friday.

The gain was well above forecasts. Economists polled by MarketWatch had forecast a 2.3% increase in gross domestic product. The economy grew at a 2.2% rate in the final three months of 2018.

Inflation moderated a bit in the first quarter.

What happened: One unexpected factor behind the acceleration in GDP growth in the first quarter was a sharp upturn in state and local government spending.

Spending at this level jumped 3.9% after a 1.3% drop in the prior three months. This was the fastest gain in three years. Spending by local governments likely picked up due to the partial federal government shutdown.

Also fueling the stronger GDP growth were stronger inventory building and trade. These factors are volatile and could reverse this quarter.

See: The big mystery in the GDP report - where did the inventories come from

Final sales to domestic purchasers, which excludes trade and inventory behavior, rose 2.3% in the first quarter, the smallest gain in three years, but still well above what economists were expecting.

The value of inventories increased to $128.4 billion from $96.8 billion, adding to GDP.

The trade sector added a little more than 1% to growth in the first quarter. Exports rose 3.7%, while imports dropped by the same amount, leading to a smaller trade deficit.

Offsetting these gains, consumer spending decelerated to a 1.2% gain, the slowest increase in a year.

Business fixed investment decelerated to a relatively slow 2.7% gain, down from a 5.4% gain in the prior quarter. Investment in structures fell 0.8%, the third straight decline.

Investment in new housing was another weak spot. Residential investment dropped 2.8%, the fifth straight quarterly decline.

Inflation, as measured by the personal consumption expenditure price index, fell to a 1.4% annual rate in the first quarter from 1.9% in the prior three-month period. The decline in core PCE inflation was less pronounced, slipping to 1.7% from 1.9%. The monthly inflation numbers will be released on Monday.

Big picture: The acceleration in growth in the first quarter is all the more remarkable considering the doom and gloom that surrounded the first-quarter outlook in December. Before the new year began, the Atlanta Fed’s “nowcast” model projected 0.5% growth and the flattening of the yield curve was fueling talk of recession. The partial government shutdown, which limited economic data, added to unease.

Instead, the economic data improved steadily as the quarter progressed. Economists think the strong gain in retail sales in March bodes well for second-quarter growth.

The Federal Reserve is not expected to change its patient approach to interest-rate policy despite the strong report. Officials are expected to wait to see how the economy fares in the second quarter before making any decisions. The solid performance in the first quarter may quell some of the chatter that the next Fed move will be a rate cut.

U.S. central bankers will meet next week to discuss the outlook. Reporters will get a chance to ask Fed Chairman Jerome Powell about the GDP data at his news conference on Wednesday.

What are they saying? “In sum, GDP growth is very impressive, while the composition was less impressive but still solid. The economy is still ploughing ahead despite the persistent pessimism that has been exacerbated by the Fed’s abrupt and mysterious abandonment of policy normalization,” said Ward McCarthy, chief financial U.S. economist at Jefferies.