BEIJING (AP) — Thousands of Muslims gathered at a mosque in northwestern China on Friday to protest its planned demolition in a rare, public pushback to the government's efforts to rewrite how religions are practiced in the country.

A large crowd of Hui people, a Muslim ethnic minority, began congregating at the towering Grand Mosque in the town of Weizhou on Thursday, local Hui residents told The Associated Press by phone.

"People are in a lot of pain," said Ma Sengming, a 72-year-old man who was at the protest from Thursday morning until Friday afternoon. "Many people were crying. We can't understand why this is happening."

Ma said the group shouted "Protect faith in China!" and "Love the country, love the faith!"

The protest comes as faith groups that were largely tolerated in the past have seen their freedoms shrink as the government seeks to "Sinicize" religions by making the faithful prioritize allegiance to the officially atheist ruling Communist Party. Islamic crescents and domes have been stripped from mosques, Christian churches have been shut down and Bibles seized, and Tibetan children have been moved from Buddhist temples to schools.

The residents of Weizhou were alarmed by news that the government was planning to demolish the mosque despite initially appearing to approve its construction, which was completed just last year.

The town's Communist Party secretary had even made a congratulatory speech at the site when the mosque's construction began, said Ma Zhiguo, a resident in his late 70s.

The authorities planned to take down eight out of the nine domes topping the mosque on the grounds that the structure was built larger than permitted, Ma said. But community members were standing their ground, he added.

"How could we allow them to tear down a mosque that is still in good condition?" he said, adding that the mosque conducts prayers attended by about 30,000 Muslims and was built using believers' personal funds. Photos online show the mosque to be a palatial white structure, with towering columns, vertical windows and a Chinese national flag erected out front.

Officials in the county and city propaganda offices said they were not aware of the situation. Other local authorities could not immediately be reached for comment.

In May, the county disciplinary inspection commission published a notice saying that Weizhou authorities had failed to properly oversee the construction of the Grand Mosque. As a result of lax supervision, the notice said, four mosques in the county had received a total of 1.07 million yuan ($156,148) in foreign donations. It did not specify whether the Grand Mosque was among the four.

Ma Sengming said protesters remained at the mosque through the night from Thursday to Friday and were twice visited by a local official who encouraged them to go home. Ma said the official did not make any specific promises, but tried to assure the protesters that the government would work with them on the matter.

More than a hundred police officers surrounded the mosque, but did not attempt to stop the protest, according to Ma.

Public demonstrations are rare in China, where the government is often quick to quash any hint of dissent. Under President Xi Jinping, the Communist Party is cracking down on religious expression and attacking what it calls radical ideas among the country's more than 20 million Muslims.

In the far west region of Xinjiang, following sporadic violent attacks by radical Muslim separatists, hundreds of thousands of members of the Uighur and Kazakh Muslim minorities have been arbitrarily detained in indoctrination camps where they are forced to denounce Islam and profess loyalty to the party.

Compared to those ethnic groups, the Hui are culturally much closer to China's Han majority, similar in appearance and speaking a variation of the mainstream Mandarin language.

But recently, reports said authorities have shut down Hui religious schools and Arabic classes and barred children from participating in Muslim activities.

James Leibold, a scholar of Chinese ethnic policies at Melbourne's La Trobe University, said the proposed demolition of the Weizhou mosque appeared to be part of a recent "far more assimilatory policy" toward ethnic minorities.

"The ultimate agenda is to erode minority identity and create a sense of belonging and connection to Chinese identity and Chinese culture," Leibold said.

___

This story has been corrected to show that Ma Sengming is a man. A quote previously attributed to Ma Sengming was made by his wife.

Copyright 2018 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.