The U.S. economy showed surprising growth from July through September just before the government’s partial shutdown.

But much of the gain came from a buildup in company stockpiles. Consumers and businesses slowed their spending — a cautionary sign for the current quarter and early 2014.

Americans did purchase more autos and other long-lasting goods. Yet most analysts say the economy isn’t showing enough underlying strength to cause the Federal Reserve to scale back its stimulus any time soon.

Overall, growth accelerated to a 2.8 percent annual rate in the third quarter, the Commerce Department said Thursday. That’s up from a 2.5 percent rate in the April-June quarter. And it’s nearly a full percentage point higher than economists had predicted.

Home construction rose at a double-digit pace, and state and local governments spent at their fastest rate in four years.

Still, the bulk of the unforeseen strength came from the buildup in company inventories. That suggests businesses overestimated consumer demand.

“The economy grew more rapidly than anticipated in the summer but for the wrong reason, due to an unwanted buildup in inventories” said Sung Won Sohn, an economics professor at the Martin Smith School of Business at California State University.

Many analysts forecast that growth is weakening in the current quarter to an annual rate below 2 percent.

Sohn said businesses are now forced to cut back on their restocking to thin out the unwanted inventories. He also said companies are likely to hold off on hiring, which would weigh further on consumer spending.

The anticipated pullback from businesses comes at a critical time. Economists estimate the shutdown will cut nearly half a percentage point from overall growth in the fourth quarter.

Still, not all analysts viewed the third-quarter report as troubling. Joseph LaVorgna, chief U.S. economist at Deutsche Bank Securities, believes the solid growth is the start of robust second half of the year.

Consumers spent more on big purchases in the third quarter, he notes. That’s a sign of confidence. And he points to recent surveys of manufacturers, which show factories are ramping up production in anticipation of greater demand.

He predicts growth will strengthen in the fourth quarter to an annual rate of 3.5 percent. If correct, that would be the strongest quarter for the economy in nearly two years.

“People say the consumer is weak … but if you delve deeper into the data, the weakness is in services,” he said. “The consumer is doing better than you think, especially on the items that are most cyclical” such as autos.

Overall government activity grew at a slight 0.2 percent rate, reflecting a 1.5 percent rise in state and local government spending — the best showing since the spring of 2009. Federal government spending dropped again, falling at a 1.7 percent annual rate.

The shutdown did not affect third-quarter growth. But it cost the U.S. economy an estimated $24 billion in October, according to Beth Ann Bovino, an economist at Standard & Poor’s.

Economists are still optimistic that 2014 will be a better year. But that hinges on lawmakers avoiding another shutdown and reaching an agreement to fund the government past Jan. 15.

Most economists agree that the dimmer outlook means the Fed is likely to maintain its $85 billion-a-month in bonds purchases through March. The purchases are intended to keep long-term interest rates low and encourage more borrowing and spending.

“The economy is not growing at a strong enough rate for the Fed to think that cutting back on its support makes sense,” said Joel Naroff, chief economist at Naroff Economic Advisors.