Economic growth in the U.S. slowed in the final part of 2018, with GDP posting a gain of just 2.2 percent in the fourth quarter, the Commerce Department reported Thursday.

The final reading was in line with expectations of economists surveyed by Dow Jones. That was down from the previous estimate of 2.6 percent and leaves full-year growth at 2.9 percent. Third-quarter growth registered 3.4 percent. In all, 2018 was the best year for the economy since 2015 and well above the 2.2 percent increase in 2017. The economy grew 3 percent when compared with the fourth quarter of 2017.

Consumer spending as well as government expenditures at the state and national levels and nonresidential fixed investment all were revised down and subtracted from the GDP. Imports also were revised lower amid continuing tensions between the U.S. and its global trading partners.

However, exports also rose, helping fuel the GDP rise.

Overall, the fourth quarter increase tied for the slowest gain since the first quarter of 2018.

Nonresidential fixed investment, a key sign of business activity, rose 5.4 percent, up from 2.5 percent in the third quarter. Equipment spending increased 6.6 percent but investment in structures fell 3.9 percent, its second consecutive decline. Residential investment also fell, down 4.7 percent for its fourth straight negative quarter.

Exports increased by 1.8 percent while imports were up 2 percent.

In addition to the waning GDP growth, corporate profits edged lower in the fourth quarter but finished the year up 7.8 percent, compared with 3.2 percent in 2017. Companies benefited from the White House-backed tax cut that slashed the corporate rate to 21 percent.

WATCH: Nobel Prize winner Robert Shiller: Housing market 'looking a little bit weaker'