BEIJING--China's exports unexpectedly rose in April for the first time this year as factories raced to make up for lost sales due to the coronavirus pandemic, but a big fall in imports signaled more trouble ahead as the global economy sinks into recession.

April's better-than-expected exports helped Asian shares trim early losses, but analysts say China's trade outlook remains bleak as major economies remain in the grip of the health crisis with rising infection numbers and deaths.

Overseas shipments in April rose 3.5% from a year earlier, marking the first positive growth since December last year, customs data showed on Thursday. That compared with a 15.7% drop forecast in a Reuters poll and a 6.6% plunge in March.

The increase was driven in part by rising exports of medical equipment, traditional Chinese medicine and textiles including masks. China exported millions of tons of medical products worth 71.2 billion yuan ($10 billion) in the March-April period, according to the customs agency. The daily export value of medical supplies jumped by more than three times last month.

Some economists also attributed the rise in exports to factory closures elsewhere, leading to a surge in import demand, just as China's manufacturers reopened after extended shutdowns due to the virus outbreak.

"Not only was the global demand taking a hit from the coronavirus, but the shock to the production side was actually more pronounced last month," said Nie Wen, economist at Shanghai-based Hwabao Trust.

A better export performance than expected could extend into May as some production constraints remain in place for other economies, Nie said.

"But I'm particularly worried about the slump in foreign demand - the impact would only be fully felt later on as world factories reopen."

In light of the rebound in April shipments, Nomura raised its forecasts for China's exports to minus 22% for May and June from minus 30% previously, but still deep in contraction as the coronavirus crisis ravages the global economy.

"Given the continued contraction of export orders in March and April--as suggested by the sharp drop in new export orders sub-index of official and Caixin manufacturing PMIs--we do not think the improvement in April's export growth is sustainable," Nomura's analysts said in a note.

Both official and private factory surveys for April showed export orders collapsed, even as some countries started easing lockdowns.

Many Chinese factories are grappling with slashed or cancelled overseas orders after reopening as global demand stays tepid. They are faced with rising inventory and falling profits, and some have let workers go as part of cost-cutting efforts.

WEAK DOMESTIC DEMAND

Imports sank 14.2% from a year earlier, the biggest contraction since January 2016 and below market expectations of an 11.2% drop. They had fallen 0.9% the previous month.

The soft imports reading was due to weak domestic demand and declines in commodity prices. The shutdowns outside China also dealt a heavy supply shock to the country's importers.

China's trade surplus for the period stood at $45.34 billion, compared with an expected $6.35 billion surplus and a surplus of $19.93 billion in March.

With the coronavirus under control domestically, China's economy has begun to open up again as authorities loosen draconian restrictions including stay-at-home orders, but economists say the recovery has been disappointing.

"There is further downside for imports too given the slow domestic recovery, already elevated inventory levels, and the fact that over a quarter of imports feed into China's export sector," said Julian Evans-Pritchard, senior China economist at Capital Economics.

"The threat of additional U.S. tariffs on Chinese goods shouldn't be ignored given the likelihood that the 'phase one' trade deal soon falls apart--imports from the United States remained near multi-year lows last month."

Customs data showed on Thursday that China imported $36.7 billion goods from the United States in the first four months of the year. That compared with a target of Chinese purchases worth about $218 billion this year under the first-phase trade deal.

U.S. President Donald Trump said he was watching closely whether China would meet its commitments to increase U.S. goods purchases under the early phase trade deal.

China could roll out more support measures to stimulate domestic demand in the event that tensions with the United States flare up again, Nie from Hwabao Trust said.