U.S. economic growth was better than expected as 2018 came to a close, with GDP rising 2.6 percent, according to a first estimate the Commerce Department released Thursday. Economists surveyed by Dow Jones expected a gain of 2.2 percent after a 3.4 percent rise in the third quarter. The growth came amid a bevy of uncertainty and a time when the stock market briefly slid into bear market territory. Growth was helped by a 2.8 percent rise in consumer spending along with increased nonresidential fixed investment, exports, private inventory investment, and federal government spending. Weakness in residential fixed investment, which fell 3.5 percent, and state and local government spending served as a drag. The gross private domestic investment gain slowed to 4.6 percent in the quarter after a robust 15.2 percent rise in the previous period. Exports rose 1.6 percent in the quarter, reversing a 4.9 percent decline in the previous quarter, while imports increased by 2.7 percent, making trade a slight net negative.

For the year, annual 2018 real GDP increased by 2.9 percent, according to the Bureau of Economic Analysis. Worries that a global slowdown would infect the U.S intensified during the period, while investors worried that the Federal Reserve would continue to raise interest rates even as financial conditions tightened. WATCH: Michelle Meyer on economy: 'Risks are higher,' including China, but slower growth more likely than a recession