Armed police held rallies in several cities in Xinjiang over the weekend, the local government news website Tianshannet reported. The site carried images showing convoys of armored vehicles and trucks full of police officers in riot gear.

China's Ministry of Foreign Affairs defended the action Monday, saying the government will "make every effort to ensure the long-term stability and development in Xinjiang."

The measures follow an outbreak of violence Wednesday in which a group attacked police stations and other government buildings in a remote Xinjiang township, Chinese state-run media said. Authorities have described it as a "terrorist attack," but overseas Uyghur groups have questioned the official version of events.

In the violence, 24 people, including two police officers, were killed, state media say, and police shot and killed 11 of the attackers and captured four others who were wounded.

State media reported further unrest in a different area of Xinjiang on Friday in which there were an unspecified number of arrests but no casualties.

Periodic bursts of violence have hit Xinjiang, a resource-rich region where the arrival of waves of Han Chinese people over the decades has fueled tensions with the Uyghurs, a Turkic-speaking, predominantly Muslim ethnic group.

The violence "poses a great threat to the country," Hua Chunying of the Foreign Ministry said Monday.

"People in Xinjiang aspire to stability, development and harmony," Hua said. "The attempts by some groups to harm stability in Xinjiang will never succeed."

Previous unrest

But Wednesday's events appeared to be the deadliest clashes since July 2009, when rioting between Uyghurs and Han Chinese left around 200 people dead and 1,700 injured in Urumqi, the regional capital.

As the anniversary of the Urumqi unrest approaches, Chinese authorities are taking a tough line.

A senior official from the ruling Communist Party called for armed police squads to carry out patrols around the clock in Xinjiang, the state-run news agency Xinhua reported at the weekend.

Meng Jianzhu, secretary of the Party's Commission for Political and Legal Affairs, asked armed police "to take precautionary and preemptive measures to strike hard on violent terrorist crimes so as to ensure a peaceful and happy life for people of all ethnic groups in the region," the agency said.

Chinese authorities haven't mentioned the ethnicity of those involved in the unrest Wednesday. State media accounts have described them as "rioters," "gangsters" and "religious extremists."

A Xinhua report Sunday said police had arrested one of them who had been on the run after the clashes. It gave his name as Yiblayan Eli, an apparently Uyghur name.

The Xinhua article reported that the group had been planning the attack since mid-June and carried it out after one of its members was arrested Tuesday.

Complaints of discrimination

Uyghurs have complained of discrimination by the Han Chinese and harsh treatment by security forces in Xinjiang, despite official promises of equal rights and ethnic harmony.

In China as a whole, Han Chinese account for 92% of the population.

They now make up about 40% of the population of Xinjiang, where Uyghurs used to be predominant.

In April of this year, clashes killed 21 people in Xinjiang's Kashgar prefecture. Regional government officials called those events "a terrorist act" carried out by "mobsters," an account that overseas Uyghur groups disputed.

"The increasing frequency with which these incidents occur illustrates the PRC's reticence to address the root causes of the tensions that are escalating," said the World Uyghur Congress (WUC), a Germany-based Uyghur advocacy group. It used an abbreviation of People's Republic of China to describe China.

"There is an ever pressing need for the PRC to afford linguistic, cultural and religious freedoms, as well as ceasing politically motivated arbitrary detentions, enforced disappearances and extrajudicial killing, in order to alleviate the recurrence of these needless and avoidable events," the WUC said.

The U.S. State Department has also commented on the situation, which has irritated Beijing.

"We're deeply concerned about ongoing reports of discrimination against and restrictions on Uighurs and Muslims in China," State Department spokesman Patrick Ventrell said last week. "And we've urged China to address those counterproductive policies, and we've urged a thorough and transparent investigation into some of this violence."

Hua, the Chinese Foreign Ministry spokeswoman, responded by saying that Chinese authorities protect the rights of ethnic groups in accordance with the law and with respect for their freedom of religion, Xinhua reported.

Hua said that the United States has been a victim of terrorism and that Beijing hopes that Washington would avoid using double standards when discussing terrorism.