BEIJING (Reuters) - Chinese President Xi Jinping warned on Sunday that any attempt to divide China will be crushed, as Beijing faces political challenges in months-long protests in Hong Kong and U.S. criticism over its treatment of Muslim minority groups.

Slideshow ( 2 images )

“Anyone attempting to split China in any part of the country will end in crushed bodies and shattered bones,” he told Nepal’s Prime Minister KP Sharma Oli in a meeting on Sunday, according to China’s state broadcaster CCTV.

“And any external forces backing such attempts dividing China will be deemed by the Chinese people as pipe-dreaming!” he was quoted as saying.

Xi, the first Chinese president to visit Nepal in 22 years, arrived in Nepal on Saturday on a state visit. Both sides are expected to sign a deal expanding a railway link between the Himalayan nation and Tibet.

Nepal’s Oli told Xi that the country will oppose any “anti-China activities” on its soil, CCTV reported.

China, which is trying to de-escalate a protracted trade war with the United States, has seen its political authority tested by increasingly violent protests in Hong Kong against what is seen as Beijing’s tightening grip on the Chinese-ruled city.

Police in Hong Kong have used rubber bullets, tear gas and water cannons against pro-democracy demonstrators in the former British colony, which has been plunged into its worst political crisis in decades.

U.S. president Donald Trump had said it would be difficult to negotiate with China if anything “bad” happens in Chinese authorities’ handling of the Hong Kong protests.

Trump said he discussed the issue of Hong Kong with Chinese Vice Premier Liu He on Saturday during their latest round of talks. Both sides reached a “phase-one deal” that has raised optimism for a broader agreement although many fundamental issues remained unresolved and existing tariffs are still not lifted.

Washington last week also blacklisted 28 Chinese companies over Beijing’s treatment of predominantly Muslim ethnic minorities. China has faced growing international condemnation for what it calls re-education and training centers in the remote western region of Xinjiang. Activists say they are mass detention camps holding more than 1 million ethnic Uighurs and other Muslims.

Before arriving in Nepal, Xi was in India for talks with Indian Prime Minister Narendra Modi to try to mend ties over the disputed Himalayan region of Kashmir amid scattered anti-China protests from Tibetan groups.

China sent troops into remote, mountainous Tibet in 1950 in what it officially terms a peaceful liberation and has ruled there with an iron fist ever since.

The Dalai Lama, Tibet’s spiritual leader, fled to India in 1959 after a failed uprising against Chinese rule. China brands him a dangerous reactionary who seeks to split off nearly a quarter of the Chinese land mass.

(The story corrects misspelling of “shattered” in headline and second paragraph).