China’s factory activity unexpectedly expanded at the quickest pace in almost three years in November, with solid increases in output and new orders, a private business survey showed on Monday.

But business confidence slipped, and companies were reluctant to replenish their inventories, worried about the uncertain outlook for demand and the prolonged China-US trade war.

The Caixin/Markit Manufacturing Purchasing Managers’ Index (PMI) index rose to 51.8 in November from 51.7 in the previous month. That marked the fastest expansion since December 2016, when it was 51.9.

The 50-mark separates expansion from contraction on a monthly basis. Economists polled by Reuters had expected a dip to 51.4.

Zhengsheng Zhong, director of macroeconomic analysis at CEBM Group, noted both domestic and overseas demand rose in November.

“Manufacturing investment may be lingering near a recent bottom,” Zhang wrote in a release accompanying the data.

“If trade negotiations between China and the US can progress in the next phase and business confidence can be repaired effectively, manufacturing production and investment is likely to see a solid improvement,” he said.

China’s official factory activity gauge on Saturday also surprised, returning to growth for the first time in seven months as domestic demand picked up in response to stimulus measures. But gains were slight and export orders sluggish.

The official survey focuses more on heavy industry than Caixin’s, which is believed to include firms that are more export oriented. The two surveys also cover different geographical areas.

The Caixin survey showed total new orders and factory production remained at buoyant levels in November, although they both eased slightly from record highs in the previous month, when they grew the fastest in over six years and nearly three years, respectively.

The sub-index for new export orders came in at 51, marginally below that in October, when it was the highest since February 2018.

Resilience in the sector led to a notable recovery in the labor market in the month, with companies adding workers for the first time in eight months.

However, profit margins remained under pressure, with input costs continuing to rise while output charges fell, suggesting some firms are still cutting their prices due to fierce competition for sales.