Photo/Illutration In this photo released by Xinhua News Agency, a container ship from Japan is anchored at the container dock of Shanghai’s Yangshan Port in east China on April 27. (Xinhua via AP)

BEIJING--China’s trade growth rebounded in May after anti-virus restrictions that shut down Shanghai and other industrial centers began to ease.

Exports surged 16.9 percent over a year ago to $308.3 billion, up from April’s 3.7 percent growth, a customs agency statement said Thursday. Imports rose gained 4.1 percent to $229.5 billion, accelerating from the previous month’s 0.7 percent.

China’s trade has been dampened this year by weak export demand and curbs imposed to fight outbreaks in Shanghai, site of the world’s busiest port, and other cities. Consumer demand for imports was crushed by rules that confined millions of families to their homes.

Forecasters have cut estimates for China’s economic growth to as low as 2 percent this year due to the Shanghai shutdown, well below the ruling Communist Party’s target of 5.5 percent. Some expect activity to shrink in the quarter ending in June before a gradual recovery begins.

Most factories, shops and other businesses in Shanghai, Beijing and other cities have been allowed to reopen but are expected to need weeks or months to return to normal activity levels.

“Exports showed considerable resilience in May despite the impact of the protracted lockdown in Shanghai,” said Rajiv Biswas of S&P Global Market Intelligence in a report. “The outlook for the second half of 2022 is for a stronger rebound in imports as domestic demand recovers.”

China’s politically sensitive global trade surplus widened by 82.3 percent over a year earlier to $78.8 billion. That was among the highest monthly trade gaps but below December’s record $94.4 billion.

China’s “zero-COVID” strategy that confined Shanghai’s 25 million people to their homes starting in late March helped to keep case numbers low but disrupted manufacturing and trade and crushed consumer demand.

The Port of Shanghai says the number of cargo containers handled each day returned to 95 percent of normal by late May. However, a backlog of tens of thousands of containers is likely to cause delays that will be felt around the world.

Import figures got a boost from higher global prices for oil and other commodities while the volume of foreign goods bought grew less strongly.

Authorities responded to complaints about the soaring cost of “zero-COVID” by switching to a more targeted approach of isolating buildings or neighborhoods with cases instead of cities. But some areas covered by restrictions that have closed shops, factories and offices for weeks at a time have millions of inhabitants.

China’s economy grew by a weak 4.8 percent over a year earlier in the quarter ending in March. That was an improvement over the 4 percent rate in the final three months of 2021, but the current quarter’s economic indicators in the current quarter are dismal.

Auto sales in April fell by almost half from a year earlier. Retail spending was off by a worse-than-forecast 11 percent.

The ruling party is trying to shore up growth with tax refunds to entrepreneurs, easier credit and spending on building public works. The World Bank warned this week that the “old playbook” policies might delay efforts to encourage growth based on consumption instead of debt-fueled investment.

High debts “store up further risks down the line,” the bank’s chief China economist, Ibrahim Chowdhury, said in a statement.

As Shanghai reopens, many factories plan to split workforces into two groups, with only one on the job at any time, to limit disruptions if there are more outbreaks and quarantines, according to foreign business groups.

“It will be months at least, and possibly years, before all the people who were working get back to work,” Carl B. Weinberg of High-Frequency Economics said in a report this week.