China's factories increased output in May for a second consecutive month, as the nation shook off the coronavirus' economic lethargy, though the weaker-than-anticipated gain indicated a recovery remains soft.

Variable data on Monday also showed a little contraction in investment, a sign many sectors were still having great difficulty with the impact of heavy shutdowns earlier this year on the world's second biggest economy.

Global leaders are monitoring China closely to see how long it takes to get back on its feet as it starts to loosen its own strict anti-virus policies and rebuild its economies.

Last month, the National Statistics Bureau increased industrial production by 4.4 percent, up from 3.9 percent in April, which was the first increase this year.

The reading was slightly short of the five percent expected in a Bloomberg survey but reflects a significant improvement on the fall of 13.5 percent in the first two months of the year.

Retail sales stayed in negative territory, shrinking 2.8 percent in May, and although it was still worse than the two percent forecast, it was much better than the April 7.5 percent contraction.

Persistent weakness in China's private sector investment and the clear wariness among consumers reflects both weak domestic conditions and the absence of robust global appetite for Chinese-made goods.

According to Shen Jianguang, JD.com Inc.'s chief economist, in a Bloomberg Television interview, the lack of demand is the "main problem for the Chinese economy right now."

Industrial output rose 4.4 percent in May, the highest reading since December last year, and a significant improvement from April's figure, according to the National Bureau of Statistics. The data was below the expectations of the analysts, as they expected an increase of 5 percent.

Factory production is getting better on the whole, but there are still a few difficulties and uncertainties, a National Bureau of Statistics official said.

Analysts say there continue to be signs of change from increased steel production and vehicle sales to more industrial parks restarting in China. Nevertheless, fears about a second wave of infections now cast a dark cloud over hopes for recovery.

Meanwhile, fixed asset investment fell 6.3 percent from the same period last year in January-May, compared with a 5.9 percent drop forecast and a 10.3 percent drop in the first four months of the year.

As in previous downturns, Beijing is banking on higher spending on infrastructure to lead a recovery, and steel mills have cranked up furnaces to more than 92 percent of capacity.