China announced Monday that its 2018 trade surplus with the United States was its largest in more than a decade, despite the tariff war initiated by President Donald Trump against Beijing.

China's surplus with the U.S. grew 17 percent from a year ago to hit $323.32 billion in 2018, according to government data. It was the highest on record dating to 2006, according to Reuters. The deficit that the U.S. has with China is likely even bigger than these figures indicate since China calculates the numbers using different methods, sometimes excluding goods that end up in the U.S. via other countries.

Exports to the United States rose 11.3 percent year on year in 2018, while imports from the U.S. to China rose a meager 0.7 percent during that period.

China said its overall trade surplus for 2018 was $351.76 billion. Exports rose 9.9 percent from 2017 while imports grew 15.8 percent over the period, official dollar-denominated data showed.

While the surplus with the U.S. may have risen, last year's overall Chinese trade surplus was the lowest since 2013, even though export growth was the highest since 2011, according to Reuters' records.

China's General Administration of Customs said Monday that the biggest worry in trade this year is external uncertainty and protectionism, forecasting the country's trade growth may slow in 2019.

Asia's largest economy is still growing steadily in 2019, but it faces external headwinds, customs spokesman Li Kuiwen said at a briefing, Reuters reported.

Economic data from China are being closely watched for signs of damage inflicted by the trade war between Washington and Beijing.

While official data indicated China's economy held up for much of last year, it now appears to be slowing. Production metrics and export orders are falling as the country's trade dispute with the U.S., its largest trading partner, drags on.

WATCH: Trump will win the trade war with China, says Gary Shilling