A People’s Liberation Army political poster in a town in Xinjiang, China, a region largely inhabited by Uighurs, an ethnic group uneasy with the government’s rule.

KHOTAN, China – The grand mosque that draws thousands of Muslims each week in this oasis town has all the usual trappings of piety: dusty wool carpets on which to kneel in prayer, a row of turbans and skullcaps for men without headwear, a wall niche facing the holy city of Mecca in the Arabian desert.

But large signs posted by the front door list edicts that are more Communist Party decrees than Koranic doctrines.

The imam’s sermon at Friday Prayer must run no longer than a half-hour, the rules say. Prayer in public areas outside the mosque is forbidden. Residents of Khotan are not allowed to worship at mosques outside of town.

One rule on the wall says that government workers and nonreligious people may not be “forced” to attend services at the mosque — a generous wording of a law that prohibits government workers and Communist Party members from going at all.

“Of course this makes people angry,” said a teacher in the mosque courtyard, who would give only a partial name, Muhammad, for fear of government retribution. “Excitable people think the government is wrong in what it does. They say that government officials who are Muslims should also be allowed to pray.”

To be a practicing Muslim in the vast autonomous region of northwestern China called Xinjiang is to live under an intricate series of laws and regulations intended to control the spread and practice of Islam, the predominant religion among the Uighurs, a Turkic people uneasy with Chinese rule.

The edicts touch on every facet of a Muslim’s way of life. Official versions of the Koran are the only legal ones. Imams may not teach the Koran in private, and studying Arabic is allowed only at special government schools.

Two of Islam’s five pillars — the sacred fasting month of Ramadan and the pilgrimage to Mecca called the hajj — are also carefully controlled. Students and government workers are compelled to eat during Ramadan, and the passports of Uighurs have been confiscated across Xinjiang to force them to join government-run hajj tours rather than travel illegally to Mecca on their own.

Government workers are not permitted to practice Islam, which means the slightest sign of devotion, a head scarf on a woman, for example, could lead to a firing.

The Chinese government, which is officially atheist, recognizes five religions — Islam, Protestantism, Catholicism, Taoism and Buddhism — and tightly regulates their administration and practice. Its oversight in Xinjiang, though, is especially vigilant because it worries about separatist activity in the region.

Some officials contend that insurgent groups in Xinjiang pose one of the biggest security threats to China, and the government says the “three forces” of separatism, terrorism and religious extremism threaten to destabilize the region. But outside scholars of Xinjiang and terrorism experts argue that heavy-handed tactics like the restrictions on Islam will only radicalize more Uighurs.

Many of the rules have been on the books for years, but some local governments in Xinjiang have publicly highlighted them in the past seven weeks by posting the laws on Web sites or hanging banners in towns.

Those moves coincided with Ramadan, which ran from September to early October, and came on the heels of a series of attacks in August that left at least 22 security officers and one civilian dead, according to official reports. The deadliest attack was a murky ambush in Kashgar that witnesses said involved men in police uniforms fighting each other.

The attacks were the biggest wave of violence in Xinjiang since the 1990s. In recent months, Wang Lequan, the long-serving party secretary of Xinjiang, and Nuer Baikeli, the chairman of the region, have given hard-line speeches indicating that a crackdown will soon begin.

Mr. Wang said the government was engaged in a “life or death” struggle in Xinjiang. Mr. Baikeli signaled that government control of religious activities would tighten, asserting that “the religious issue has been the barometer of stability in Xinjiang.”

Anti-China forces in the West and separatist forces are trying to carry out “illegal religious activities and agitate religious fever,” he said, and “the field of religion has become an increasingly important battlefield against enemies.”

Uighurs are the largest ethnic group in Xinjiang, accounting for 46 percent of the population of 19 million. Many say Han Chinese, the country’s dominant ethnic group, discriminate against them based on the most obvious differences between the groups: language and religion.

The Uighurs began adopting Sunni Islam in the 10th century, although patterns of belief vary widely, and the religion has enjoyed a surge of popularity after the harshest decades of Communist rule. According to government statistics, there are 24,000 mosques and 29,000 religious leaders in Xinjiang. Muslim piety is especially strong in old Silk Road towns in the south like Kashgar, Yarkand and Khotan.

Many Han Chinese see Islam as the root of social problems in Xinjiang.

“The Uighurs are lazy,” said a man who runs a construction business in Kashgar and would give only his last name, Zhao, because of the political delicacy of the topic.

“It’s because of their religion,” he said. “They spend so much time praying. What are they praying for?”

The government restrictions are posted inside mosques and elsewhere across Xinjiang. In particular, officials take great pains to publicize the law prohibiting Muslims from arranging their own trips for the hajj. Signs painted on mud-brick walls in the winding alleyways of old Kashgar warn against making illegal pilgrimages. A red banner hanging on a large mosque in the Uighur area of Urumqi, the regional capital, says, “Implement the policy of organized and planned pilgrimage; individual pilgrimage is forbidden.”

As dozens of worshipers streamed into the mosque for prayer on a recent evening, one Uighur man pointed to the sign and shook his head. “We didn’t write that,” he said in broken Chinese. “They wrote that.”

He turned his finger to a white neon sign above the building that simply said “mosque” in Arabic script. “We wrote that,” he said.

Like other Uighurs interviewed for this article, he agreed to speak on the condition that his name not be used for fear of retribution by the authorities.

The government gives various reasons for controlling the hajj. Officials say that the Saudi Arabian government is concerned about crowded conditions in Mecca that have led to fatal tramplings, and that Muslims who leave China on their own sometimes spend too much money on the pilgrimage.

Critics say the government is trying to restrict the movements of Uighurs and prevent them from coming into contact with other Muslims, fearing that such exchanges could build a pan-Islamic identity in Xinjiang.

About two years ago, the government began confiscating the passports of Uighurs across the region, angering many people here. Now virtually no Uighurs have passports, though they can apply for them for short trips. The new restriction has made life especially difficult for businessmen who travel to neighboring countries.

To get a passport to go on an official hajj tour or a business trip, applicants must leave a deposit of nearly $6,000.

One man in Kashgar said the imam at his mosque, who like all official imams is paid by the government, had recently been urging congregants to go to Mecca only with legal tours.

That is not easy for many Uighurs. The cost of an official trip is the equivalent of $3,700, and hefty bribes usually raise the price. Once a person files an application, the authorities do a background check into the family. If the applicant has children, the children must be old enough to be financially self-sufficient, and the applicant is required to show that he or she has substantial savings in the bank. Officials say these conditions ensure that a hajj trip will not leave the family impoverished.

Rules posted last year on the Xinjiang government’s Web site say the applicant must be 50 to 70 years old, “love the country and obey the law.”

The number of applicants far outnumbers the slots available each year, and the wait is at least a year. But the government has been raising the cap. Xinhua, the state news agency, reported that from 2006 to 2007, more than 3,100 Muslims from Xinjiang went on the official hajj, up from 2,000 the previous year.

One young Uighur man in Kashgar said his parents were pushing their children to get married soon so they could prove the children were financially independent, thus allowing them to qualify to go on the hajj. “Their greatest wish is to go to Mecca once,” the man, who wished to be identified only as Abdullah, said over dinner.

But the family has to weigh another factor: the father, now retired, was once a government employee and a Communist Party member, so he might very well lose his pension if he went on the hajj, Abdullah said.

The rules on fasting during Ramadan are just as strict. Several local governments began posting the regulations on their Web sites last month. They vary by town and county but include requiring restaurants to stay open during daylight hours and mandating that women not wear veils and men shave their beards.

Enforcement can be haphazard. In Kashgar, many Uighur restaurants remained closed during the fasting hours. “The religion is too strong in Kashgar,” said one man. “There are rules, but people don’t follow them.”

One rule that officials in some towns seem especially intent on enforcing is the ban on students’ fasting. Supporters of this policy say students need to eat to study properly.

The local university in Kashgar adheres to the policy. Starting last year, it tried to force students to eat during the day by prohibiting them from leaving campus in the evening to join their families in breaking the daily fast. Residents of Kashgar say the university locked the gates and put glass shards along the top of a campus wall.