An injured police officer addresses people during mass rioting in the southern Biryulyovo district of Moscow. Thousands rioted on Oct. 13 in Moscow, bashing in the doors and windows of a shopping centre and beating up security guards in a nationalist protest sparked by a murder blamed on a migrant. (AFP/Getty Images)

Defined by two rail lines and the outer ring highway, Moscow’s Biryulyovo district is home to a factory making reinforced concrete slabs, a brewery, a cracker bakery and the city’s largest wholesale produce market, which is staffed by more than 1,000 migrants, drawn from the Caucasus Mountains by the lure of jobs.

Ethnic Russians who live in Biryulyovo chafe at the sight of the Muslim strangers who have descended on their district and seethe about police collusion with the market bosses. Residents accuse police of looking the other way as landlords crammed as many as 17 people into one apartment and say officers routinely shake down illegal migrants for bribes while allowing them to stay on.

Then last week, a young Russian man was stabbed to death in an argument about his girlfriend. On Tuesday, police said they had detained a man from Azerbaijan and plan to charge him in the killing — but by that time Biryul­yovo was already Russia’s biggest news story. Angry young men and some women, many apparently fueled by vodka, had stormed the market Sunday, smashing doors and windows and looking for migrants to assault — and when the police belatedly intervened, the mob attacked them instead.

More than 300 people were detained, and several were hospitalized.

But since then, city officials have been scrambling to placate the Russians who feel offended by the migrants and abandoned by their public servants. It’s not the easiest of maneuvers, because Moscow’s leaders have been profitably pitting migrants against residents for years, taking advantage of both.

Until Sunday’s riot, residents said, no one had listened to their complaints about the killing.

“You do not want feedback?” asked Alexander Shumsky, head of a citizens group called that tries to find solutions to urban problems. (The name is a play on the Russian words for “No traffic jams.”)

“So you got it anyway,” he wrote in his blog, “just in a different form.”

Only three of the rioters face charges. On Tuesday, the police department fired the head of the Biryulyovo detachment, as well as his immediate superior.

Officials promised new regulations making it harder for foreigners to rent or buy Moscow apartments, though this would achieve little because most migrants here are either Russian citizens from the Caucasus or are already in illegal living situations, greased with bribes.

Health officials shut down the market, posing another problem: It handles 60 percent of Moscow's fruit and vegetables. Trucks were backed up Tuesday, with nowhere to deliver their loads.

Also Tuesday, the Russian Orthodox Church called for volunteer patrols to identify illegal migrants, in apparent recognition that the police don’t enforce the law. The Interior Ministry said police had detained 1,245 migrants who work at the market in order to check their documents — as if the local beat cops didn’t already know who was in the city illegally — and charged 214.

It was not clear how many of those facing prosecution were among the victims of Sunday’s riot.

In an interview with that ran Tuesday, Mayor Sergei Sobyanin said Moscow must be on guard against the development of ethnic neighborhoods — which he called “Chinatowns” — such as those in New York that he said anyone would be afraid to enter.

But Moscow depends on migrants to do the dirty jobs, especially in cleaning and construction, and their advocates say contractors with good connections at City Hall underpay their employees and spread the remainder among friends.

And Sobyanin has personally done well in places where migrants predominate. An investigation by the Web site found that he had done better in Biryulyovo than in all but one of the city’s districts in last month’s election. His vote total was highest in apartment blocks next to the market — suggesting that migrants’ ballots had been rounded up and packaged on his behalf.

Other market precincts in Moscow showed similar spikes in favor of Sobyanin, the Web site reported.

Ordinary Muscovites feel deeply vulnerable, Lev Gudkov, head of the Levada Center polling organization, told the newspaper Nezavisimaya Gazeta.

“It stems from the unfair social system and corruption,” he said. “The people are certain that the law enforcement agencies do not protect them.”

Officials initially attributed Sunday’s riot to Russian nationalists, but it now appears to have been more of a spontaneous outburst.

“The riot was not against the people of another nation, but against illegal immigrants, against a corrupt and venal system,” Shumsky wrote.

“There were no nationalists,” said Ragim Mirzoyev, 51, an Azerbaijani who has lived in Biryulyovo for 25 years. “Their friend was killed. They drank. They wanted revenge. They were very angry, so they needed to express their anger.”

Mirzoyev was celebrating the Muslim holiday Eid on Tuesday, as did thousands of others who overflowed Moscow’s few mosques. “We worry about what happened,” he said. “It was tense, but it will pass. You know, there were riots in ’87, in ’89. It comes in waves.”

Police turned out in force to ensure order Tuesday, but imams warned the more than 1 million Muslims in the city not to travel by public transport Tuesday evening, because of the risk of attacks.