WASHINGTON — The U.S. economy expanded at a healthy annual 2.4% pace the final three months of 2024, supported by a year-end surge in consumer spending, the government said Thursday in a slight upgrade of its previous 2.3% estimate of fourth-quarter growth.

But it’s unclear whether the United States can sustain that growth as President Donald Trump wages trade wars, purges the federal workforce and promises mass deportations of immigrants working in the country illegally.

Growth in gross domestic product — the nation’s output of goods and services — decelerated from a 3.1% pace in July- September 2024, the Commerce Department said.

For all of 2024, the economy — the world’s biggest — grew 2.8%, down a tick from 2.9% in 2023.

Consumer spending rose at a 4% pace, up from 3.7% in third-quarter 2023. But business investment fell, led by an 8.7% drop in investment in equipment.

A drop in business inventories shaved 0.84 percentage points off fourth-quarter GDP growth.

A category within the GDP data that measures the economy’s underlying strength rose at a healthy 2.9% annual rate in the fourth quarter, slipping from the government’s previous estimate of 3.2% and from 3.4% in the third quarter. This category includes consumer spending and private investment but excludes volatile items like exports, inventories and government spending.

The report released Thursday was the government’s third and final look at fourth-quarter GDP.