BEIJING (Reuters) - Chinese Muslims should promote social harmony and resist illegal religious “infiltration”, President Xi Jinping said while visiting a mosque in a heavily-Muslim part of western China, state media reported on Thursday.

Chinese President Xi Jinping makes a speech at the celebration of the 95th anniversary of the founding of the Communist Party of China at the Great Hall of the People in Beijing, China, July 1, 2016. REUTERS/Kim Kyung-Hoon

There are about 21 million Muslims in China, ranging from the Uighur people who live in the violence-prone far western region of Xinjiang to the Hui, many of whom are highly Sinified, and other ethnic groups.

China’s constitution guarantees religious freedom, but rights groups say the officially atheist ruling Communist Party seeks to restrict religious practice, especially for Muslims. China strongly denies such charges.

Touring Ningxia, home to about 2.4 million mostly Hui Muslims, Xi said Chinese Muslims should practice their religion as part of Chinese society and “carry forward the patriotic tradition”, the official China Daily said.

“Religions in our country, the endemic ones and those from abroad, have become deeply embedded in the Chinese civilisation, whose history covers more than 5,000 years,” Xi said while visiting a mosque in Ningxia’s regional capital Yinchuan.

“They will continue to flourish while taking root here.”

Muslims must “resolutely oppose illegal religious infiltration activities” and promote religious and social harmony, Xi said, the official Xinhua news agency added, without elaborating.

The Chinese government says it has been facing a rise in Islamic extremism, especially in Xinjiang, where hundreds have died in violence in recent years.

Beijing blames foreign extremists for stirring up tensions, particularly in Xinjiang, where it says it faces a determined campaign by extremist separatists who want to establish an independent state called East Turkestan.

But many rights groups and exiles doubt the existence of a coherent extremist group in Xinjiang, and say Uighur anger at repressive Chinese policies is more to blame for the unrest.