The gloom among foreign companies in China is deepening.

The world's second largest economy is slowing down, making life harder for both Chinese and Western firms in the country. But a new survey of European companies claims they're getting a tougher deal than their Chinese rivals.

"A business environment that is increasingly hostile combined with a playing field that is perpetually tilted in favor of domestic enterprises means the effects of the slowdown are intensified for European business," the report by the European Union Chamber of Commerce in China said Tuesday.

Related: 3 flash points between the US and China

Fifty-six percent of firms that responded to the survey said doing business in China has become more difficult, a five percentage point increase from a year earlier. Complaints included recent tightening of Internet controls and inconsistent enforcement of regulations.

The proportion of companies planning to expand their operations in China has slumped to 47% -- three years ago the number stood at 86%. And a significant amount (41%) say they're planning to cut costs.

The worries were echoed in comments by U.S. Treasury Secretary Jack Lew, who's in Beijing for talks with top Chinese officials.

"Concerns about the business climate have grown in recent years with foreign business confronting a more complex regulatory environment and questioning how welcome they are," he said.

Related: Fears after China troubles for Apple and Disney

In a survey earlier this year by the American Chamber of Commerce in China, 77% of firms who responded said they felt less welcome in the country than before.

"Our members are concerned about measures they see as being used against them," James Zimmerman, the group's chairman, said last week.

Chinese state media have said complaints from foreign companies about the country's business environment don't reflect reality.

Chinese companies have also come up against challenges with access to the U.S. market. Tech giant Huawei has faced restrictions on building up its telecom equipment business in the U.S. because of security concerns.