Economic growth in the United States for the fourth quarter last year was revised up unexpectedly, government data showed on Thursday, helped by higher estimates of consumer spending and investment.

GDP growth in the world's largest economy was pegged at an annual rate of 3.4 percent in the final three months of 2023, said the Commerce Department in its latest report.

The figure was above both its first and second estimates of 3.3 percent and 3.2 percent respectively.

"The update primarily reflected upward revisions to consumer spending and nonresidential fixed investment," said the Commerce Department.

But this was "partly offset by a downward revision to private inventory investment," the report added.

Full-year growth was still at 2.5 percent.

Analysts had generally anticipated the GDP estimates would remain unchanged at 3.2 percent, but the number exceeded expectations.

Although experts predicted consumer spending would cool as households depleted their savings from the pandemic period and as borrowing costs remained high, consumption remained resilient last year.

The US economy also defied predictions of a recession, fueling optimism that it is on the road to a "soft landing" where inflation comes down without triggering a damaging recession.