China’s official factory gauge rose more than estimated as export orders accelerated, signaling trade continues to drive expansion as the global economy powers through risks.

The manufacturing purchasing managers index rose to 51.9 in May, exceeding all forecasts in Bloomberg’s survey of economists, who projected the gauge to remain unchanged at 51.4. The non-manufacturing PMI, covering services and construction, rose for a third straight month to 54.9, the statistics bureau said Thursday, from 54.8 in April. Levels above 50 indicate improvement.

The PMI for new export orders increased to 51.2 from 50.7, readings of input and output prices climbed and inventories and backlogs of work declined.

Activity is holding up even as debt curbs, trade tensions with the U.S. and political strife from Turkey to Italy cloud the overall outlook. A temporary truce between the two biggest economies on trade is in danger of breaking down after President Donald Trump said this week that the U.S. will pursue tariffs on Chinese goods, a potential headwind for domestic manufacturing.

The PMI strength “highlights resilience of the economy at a time of external threats such as trade tensions with the U.S.,” said Dariusz Kowalczyk, senior emerging-market strategist at Credit Agricole SA in Hong Kong. “Improved sentiment bodes well for activity in coming months across industries.”

The economy is stable with improvement and the trend is sustainable, China National Radio reported Thursday, citing Premier Li Keqiang’s comments at a May 29 meeting.

Still, the proportion of companies with tight funding conditions went up for a third month to 40.1 percent in May, underscoring the need to further strengthen financial support for the real economy, the statistics bureau said in a statement on its website.

Short-Lived?

The rebound “might be short lived, as growth of end demand such as infrastructure and property investment slumped in the past several months due partially to the government’s deleveraging efforts,” said Lu Ting, chief China economist at Nomura Holdings Inc. in Hong Kong. “We’re going to see strong headwinds in the second half.”

More than 40 percent of businesses complained about labor and input prices, showing higher costs remain a major difficulty, the bureau said. An input prices sub-index rose to 56.7 from 53 a month earlier.

“On the back of the concern about a slowing economy and the need to prioritize expanding domestic demand, the government has also been taking measures to boost infrastructure spending and front-load budgeted projects since a few weeks ago,” Chang Jian, chief China economist at Barclays Plc in Hong Kong, said in a Bloomberg Television interview.

The World Bank said in a report released Thursday that external risks for China have become more prominent and high corporate debt is the main domestic challenge. Bank economists maintained their forecast for the expansion to decelerate to 6.5 percent this year.

The strong PMI reading should offer some relief for those concerned about an economic slowdown, according to Raymond Yeung, chief greater China economist for Australia & New Zealand Banking Group Ltd. in Hong Kong.

“An outperforming first half can offer a buffer for China to deal with global uncertainties including a potential softening of European demand and Trump’s ad hoc measures,” he said.