In this Feb. 23, 2020 file photo, workers make optical lenses at a factory in Dexing, central China's Jiangxi province. (Chinatopix Via AP)

BEIJING (AP) -- China's exports fell by double digits in January and February as anti-virus controls closed factories, while imports sank by a smaller margin.

Exports tumbled 17.2% from a year earlier to $292.4 billion, a sharp reverse from December's 7.8% rise, customs data showed Saturday. Imports declined 4% to $299.5 billion, down from the previous month's 16.3% gain.

Trade was poised for a boost after Beijing and Washington removed punitive tariffs on some of each other's goods in a trade truce signed in January. But that was offset by Chinese anti-virus controls that shut down much of the world's second-largest economy in late January.

Exports to the United States plunged 27.7% in January and February to $43 billion, worsening from December's 12.5% decline. Imports of American goods crept up 2.5% to $17.6 billion, but China still recorded a $25.4 billion trade surplus with the United States.

China's global trade balance fell to a $7.1 billion deficit for the first two months of the year.

Manufacturers that make the world's smartphones, toys and other consumer goods are reopening but say the pace will be dictated by how quickly supply chains start functioning again. Forecasters say industries are unlikely to be back to normal production before at least April.

Until the virus outbreak, Chinese trade had been unexpectedly resilient despite Beijing's tariff war with President Donald Trump over its technology ambitions and trade surplus. Last year's exports rose 0.5% over 2018.

Beijing told exporters to pursue other markets in Asia, Europe and Africa after Trump slapped punitive duties on their goods starting in 2018. China retaliated by raising tariffs on American soybeans and other goods.

Some of those penalties were rolled back after the two sides signed a "Phase 1" agreement in January. Washington canceled additional planned tariff hikes and Beijing promised to buy more American farm exports.

Economists warn the truce fails to address contentious U.S.-Chinese disputes that might take years to resolve.

China's customs agency began reporting January and February trade figures together this year to screen out the impact of the Lunar New Year holiday, which comes at different times each year during the two-month period.

Factories traditionally usually shut down for two weeks or longer while their employees visit their hometowns.

Imports usually surge after the holiday as factories restock. But this year's rebound was postponed after the holiday was extended by at least one week -- more in some places -- to keep factories and offices closed as authorities tried to contain the spread of the coronavirus.

Chinese leaders are trying to limit economic damage by ordering local officials in areas deemed at low disease risk to help factories reopen. But many say they have trouble getting raw materials and employees because controls on travel still are in place in many areas.

The Chinese shutdown sent shockwaves through Asian economies that supply components and raw materials to Chinese factories that assemble the world's smartphones, toys, home appliances and other consumer goods.

Shopping malls, restaurants and other retail businesses also were closed. Demand for online grocery vendors surged but sales of other goods slumped.