They call it "Little Mecca": a city of prayer caps and hijab, minarets and oxidized green domes.

In some ways, Linxia, in northern China's Gansu province, is a city united. About 60% of its 250,000 people are Muslim. On a frigid Friday afternoon in December, its street life grinds to a halt. Hundreds of men wearing scruffy beards and white caps pack into the tile-clad Xinhua Mosque for afternoon prayers. An imam chants Koranic passages in throaty Arabic. A speaker crackles, and a flock of birds takes flight.

It's also a city divided. There are the mainstream Muslims, locals say — and then there are the Salafis.

Salafism is an ultra-conservative school of thought within Sunni Islam, espousing a way of life and prayer that harks back to the 6th century, when Muhammad was alive. Islamic State militants are Salafi, many Saudi Arabian clerics are Salafi, and so are many Chinese Muslims living in Linxia. They pray at their own mosques and wear Saudi-style kaffiyehs.

The growth in the Salafi movement here has rattled China's officially atheist communist government, which finds any expression of religious fervor to be unnerving, especially when it carries associations with foreign extremists.

By Sunday evening, the death toll from what one newspaper affiliated with the Communist Party called “China’s 9/11” stood at 29 dead and 130 injured. More than 70 remained hospitalized in critical condition. Four attackers were also slain, and one woman was said to be in custody.

The Chinese public increasingly associates Islam with terrorism, and many other Chinese Muslims see Salafis as fanatics, unable to successfully navigate mainstream Chinese society.

Experts say that in recent years, Chinese authorities have put Salafis under constant surveillance, closed several Salafi religious schools and detained a prominent Salafi cleric. A once close-knit relationship between Chinese Salafis and Saudi patrons has grown thorny and complex.

Locals in Linxia say that in the city, relations are good, but in the countryside, where traditions are more entrenched, spiritual disagreements have created a deep social divide.

Although many Chinese Salafi are avowedly nonviolent and apolitical, their faith is fraught with risk, underscoring an increasingly strained relationship between the Chinese state and its Muslim citizens.

"China discriminates against religious people — not only Salafis, but also people from other religions," said a local Salafi man who, like many interviewees in Linxia, requested anonymity given the sensitivity of the subject. "We don't have equal rights."

Estimates of the number of Chinese Salafis are vague, ranging from thousands to tens of thousands. Yet experts and Linxia Muslims agree that the movement, which is growing worldwide, is also gaining traction in China, even among ethnic Han Chinese.

"I've been studying Muslims in China for the past 30 years, and it's only over the past four or five that we see young Han men converting to a radical, conservative Islamic ideology," said Dru Gladney, an expert on Chinese Muslims at Pomona College. "Not politically radical, but radically conservative, radically orthodox."

"Clearly Muslim ideologies can be very powerful," he continued. Islamic State "is appealing to many marginalized young men throughout the world. And I think Han Chinese men, as well as younger [Chinese Muslims], look at this and say, 'What are the alternatives to communism, to capitalism, to socialism?'"

Chinese Muslims are diverse, but most fall into two groups. Uighurs, a Turkic-speaking minority group, live primarily in the northwestern region of Xinjiang; culturally and religiously, they hew closer to Central Asia than to Beijing.

Authorities blame Uighur "separatists" and "terrorists" for scores of violent attacks in recent years, and intermittently place swaths of the region under military lockdown.

Then there are the Hui people, who live throughout the country, tend to be well-assimilated into mainstream Chinese society and are generally free to pray as they please.

Experts say that Salafism is spreading among both groups — and although they barely communicate, their fates have collided in ways that remain poorly understood.

On March 1, 2014, four Uighur assailants hacked 31 people to death at a train station in Kunming, the capital of the southern province of Yunnan. Soon afterward, Chinese state media reported that the assailants planned the attack from Shadian township, a Salafi stronghold about 150 miles to the south.

That September, provincial officials introduced a new piece of legislation — called Document 14 — which pledged to "strengthen management" of the province's Arabic language and Islamic studies schools, or madrassas.

Ding Long, an adjunct Arabic professor at the University of International Business and Economics in Beijing, said that the government has since shuttered many of Shadian township's madrassas over concerns that they could be breeding grounds for violence.

"In the beginning, the government didn't notice the influence, the dangers of [Salafist] thought," he continued. "Then they finally realized that this was very dangerous — that they undermine the balance of the different groups within the Muslim community in China."

In late 2015, authorities from Xinjiang detained Ma Jun, an influential Salafi imam and teacher in Gansu's capital, Lanzhou, and released him 27 days later, according to overseas Chinese media reports. Authorities had detained one of Ma's students, a Uighur, on suspicion of "studying religion with an illegal organization" and "endangering state security," and found a recording of Ma's lectures on his phone.

Ma had "good ties to the state," said a scholar who requested anonymity to avoid complications with Chinese authorities. The incident "shows how serious things are becoming and how much the problems in Xinjiang are spilling over into Gansu and Qinghai."

Even in Linxia, which prides itself on sectarian accord, there are signs that the authorities are on edge. Propaganda is ubiquitous — mosques are festooned with massive government banners calling for "unity," "harmony" and "patriotism."

Salafism first arrived in China about a century ago, went underground during Mao Tse-tung's anti-religious campaigns of the 1960s and '70s and came back in force during the 1980s and '90s, after Mao died and his Cultural Revolution ended.

In 1984, Beijing began allowing individual Chinese Muslims to make the hajj, the pilgrimage to Mecca, Saudi Arabia, and by 1990, nearly 10,000 Hui were flying out each year. Some learned about Salafism and, enamored with the idea of a "purer" form of Islam, spread its teachings at home.

Meanwhile, Saudi preachers and organizations began traveling to China. Some of them bore gifts: training programs for clerics, Korans for distribution, funding for new "Islamic institutes" and mosques.

"This exposure to Saudi discourses actually caused a momentary implosion within the Salafi community in the 1980s," said Mohammed Al-Sudairi, a doctoral student at the University of Hong Kong who spent years researching Salafi Muslims in China.

"The new generation, which was much more engaged and influenced by Saudi Arabia, began to contest the knowledge of the older generation. You had a lot of excommunication within the [Muslim] community, people were saying to each other that they were not real Muslims."

In recent years, the Saudi-China grass-roots relationship has grown more complex. Experts say that Beijing increasingly views foreign religious influence as a threat and that Chinese Salafis have rejected overtures from Saudi patrons, fearful about how officials — and other Chinese Muslim groups — would react.

China's relationship with Saudi Arabia, the world's second-biggest oil producer, has not suffered any obvious setbacks.

In mid-January, Xi met with Saudi King Salman in his capital, Riyadh. The leaders pledged to deepen "energy cooperation" and to "resolutely oppose terrorism in any form," according to the official New China News Agency.

"To some extent I think Beijing has turned a blind eye" to Saudi funding of Salafis in the past, said James Frankel, an expert on Islam in China at the Chinese University of Hong Kong. "That may be changing now, perhaps, because of fears of extremism."

In Linxia, few worshipers were willing to discuss the issue.

One man at the Xinhua Mosque, dressed in a beige jacket and white skullcap, had arrived early for evening prayers. "The Han like us because we care about cleanliness and peace," he said. His eyes darted anxiously. He refused to answer questions about the city's many sects; he did not give his name. Above, a fluttering propaganda poster encouraged the spread of "positive energy."

"We're a peace-loving people," he added. "We care about unity and harmony."

Yingzhi Yang, Nicole Liu and Tommy Yang in The Times' Beijing bureau contributed to this report.

A version of this article appeared in print on February 03, 2016, in the News section of the Los Angeles Times with the headline "Salafi Islam raises qualms in China - Sect's rise, ties to extremism worry atheist government" —
Today's paperToday's paper | Subscribe