The U.S. economy was unexpectedly strong in the fourth quarter of last year after a spurt of faster growth in the second and third quarters, with consumers keeping up spending and businesses expanding investment amid fears of higher interest rates and a rocky stock market.

Gross domestic product—the value of all goods and services produced in the U.S., adjusted for inflation—expanded at an annual rate of 2.6 percent for the months October through December, the Commerce Department said Thursday. That marked a slowdown from the 3.4 percent growth rate registered in the July through September period and the booming 4.2 percent rate in the April through June.

This was the weakest growth rate since the first quarter of 2018. But it was faster than expected. Economists had expected the Commerce Department to report a 2.2 percent growth rate. The Atlanta Fed’s GDPNOW model had pointed to even weaker growth of just 1.8 percent.

The “initial” fourth-quarter GDP estimate was released a month late, when the government would typically issue its second read of GDP, because of the government shutdown.

Economists think the economy will continue to grow throughout 2019, thanks to a very strong labor market that continues to enjoy ultralow unemployment rate, robust job growth, and steady wage growth. The Federal Reserve pivoted in January from a policy of gradually raising rates to one of “patience,” a move which many see as supporting further growth and that has buoyed financial markets at the start of the year. The Fed predicts GDP will grow 2.3 percent this year.

But growth is expected to be lower this year, not touching the heights of last year’s summer and fall. Some economists think the economy could fall into a recession in 2020, which might weigh on voters in that year’s presidential election.

Consumer spending slowed but not by as much as many economists expected. This rose at an inflation-adjusted, annualized rate of 2.8 percent in the fourth quarter. Spending on durable goods actually increased, defying expectations that trade fights and tariffs would drag on this area of the economy, while spending on services and nondurable goods slowed.

Also defying predictions of a trade fight slowdown was a rise in business investment. Nonresidential fixed investment–a category that includes research and development spending, software and equipment purchases–grew at a 6.2 percent rate, much higher than the 2.5 percent rate recorded in the prior quarter. This seems to indicate that the tax cuts are boosting business investment, something Trump administration economists predicted but many outside the administration thought was unlikely.

Inflation was muted in the fourth quarter. The price index for personal consumption expenditures, a measure of inflation that tracks – but is different from – the better known Consumer Price Index, rose at a 1.5 percent pace in the fourth quarter. Core inflation–which excludes food and energy–was up just 1.7 percent. Both are lower than the 2 percent rate targeted by the Federal Reserve.

Compared with a year earlier, output in the fourth quarter was 3.1 percent higher. Total output for the year was 2.9 percent above 2017’s output.