BEIJING (AP) — China’s 2018 trade surplus with the United States surged to a record $323.3 billion but exports contracted in December as the delayed impact of President Donald Trump’s tariff hikes started to hurt demand.

Exports to the United States in 2018 rose 11.3 percent to $478.4 billion despite Trump’s punitive duties in a fight over Chinese technology ambitions, customs data showed Monday. Imports of American goods rose just 0.7 percent over 2017, reflecting Beijing’s retaliatory tariffs and encouragement to importers to buy more from non-U.S. suppliers.

In December, Chinese exports to the United States that had held up through much of the year fell 3.5 percent from a year earlier to $40.3 billion. Sales to the U.S. market had kept growing by double digits in previous months as Chinese exporters rushed to fill orders, but forecasters said American orders would slump once the full impact of Trump’s penalties hit.

The slowdown adds to pressure on Beijing to resolve the battle with Trump at a time when the ruling Communist Party also is trying to reverse an economic slowdown.

“The external environment is still complicated and severe,” a customs agency spokesman, Li Kuiwen, said at a news conference.

Li cited dangers including “protectionism and unilateralism” — a reference to Trump’s import controls — a possible slowdown in global economic growth and a decline in cross-border investment.

U.S. and Chinese officials ended a three-day negotiating session last week with no sign of agreements or word on what their next step would be.

“The record U.S. trade deficit with China will sit uncomfortably with the Trump administration,” Nick Marro of the Economist Intelligence Unit said in a report. “That may cast a shadow over the next round of trade talks.”

Trump and his Chinese counterpart, Xi Jinping, agreed on to postpone additional tariff hikes by 90 days while they negotiated. But penalties of up to 25 percent already imposed on billions of dollars of each other’s goods remain in place, raising the cost for American and Chinese buyers of soybeans, medical equipment and other goods.

Trump is pressing Beijing to roll back plans for state-led creation of Chinese champions in robotics and other tech fields. Washington, Europe and other trading partners complain such policies violate its market-opening obligations. Chinese officials have suggested initiatives such as “Made in China 2025″ might be opened to foreign companies, but they refuse to abandon strategies they see as a path to prosperity and more global influence.

Chinese leaders are trying to reduce reliance on trade and nurture self-sustaining economic growth based on domestic consumer spending. But their plans call for keeping exports stable to avoid politically dangerous job losses.

Some companies have shifted production of goods bound for the United States out of China to avoid Trump’s tariffs. Others are lining up non-Chinese suppliers of industrial components.

December’s trade contraction is “like to continue into 2019 due to falling foreign demand, including demand for Chinese-made electronic products,” Iris Pang of ING said in a report.

Pang noted Chinese imports of more advanced technology for use in manufacturing smartphones and other higher-technology products declined 14.9 percent in December, nearly double the size of the contraction in overall trade.

That likely is due in part to “foreign companies avoiding using China-made electronic components,” said Pang in a report.

In December, China’s global exports shrank 4.5 percent to $221.2 billion while imports declined 7.2 percent to $164.2 billion.

For the full year, global exports rose 7.1 percent to $2.5 trillion, down from the 7.9 percent rate for 2017. Imports rose 12.9 percent to $2.1 trillion, down from the previous year’s 15.9 percent.

The country’s global trade surplus was $352 billion, a marked drop from 2017’s $509.7 billion. That reflects relatively stronger Chinese economic growth and consumer demand compared with its trading partners.

Given Trump’s frustration with China’s huge trade gap with the United States, the latest data might fuel demands by hardliners in Washington to punish Beijing.

Still, Louis Kuijs of Oxford Economics says he expects Washington to extend its 90-day deadline following the “positive vibes” of last week’s talks.

“We do not see the U.S. fully removing the specter of tariff hikes any time soon,” he said in a report. But a deal for “a more lasting suspension of new tariffs” looks more likely.

General Administration of Customs of China (in Chinese): www.customs.gov.cn