Moscow: Violent rampages outside the Kremlin have highlighted the need to strengthen public order and raise police prestige, Prime Minister Vladimir Putin said on Thursday.

Putin spoke after a weekend rally of 5,000 racists and hooligans in Moscow left more than 30 people injured and raised doubts about the government's ability to stem a rising tide of xenophobia.

Police on Wednesday, however, prevented a replay of the violence between nationalists and mostly Muslim ethnic minorities in the capital and several other cities, detaining hundreds.

Putin said during a call-in session broadcast live on Russian state television and radio that the violence demonstrated the importance of maintaining law and order. He used the occasion to lash out at liberal critics who have criticised his government of sending riot police to disband opposition protests.

"It's necessary to prevent extremism from all flanks," Putin said. "The liberal community must understand the need for maintaining order. The government exists to protect the majority's interests."

He continued a scathing attack on his critics, saying that the rallies demonstrated the need to raise the prestige of the nation's police force. The force has faced public criticism over corruption and other abuses.

"We mustn't paint them all in black and bring them down," Putin said. "Or otherwise the liberal intellectuals will be the ones who have to shave their thin beards off, put helmets on and go out on the square to fight the radicals."

Preceding Putin's comments, his longtime aide Vladislav Surkov, now serving as the Kremlin's deputy chief of staff, accused critics of the government of helping pave the way for racist hooligans by holding unauthorised rallies. "People were different, but their attitude was the same," he said in an interview published yesterday in the daily newspaper Izvestia.

Many Russian observers in the past have noted links between nationalist groups and some part of officialdom, saying that hard-liners within the government may be supporting the nationalists to justify tight Kremlin controls and fend off efforts to open up Russia's political system.

While Russian police quickly and brutally disperse peaceful protests by anti-Kremlin activists, some nationalist groups have been allowed to hold their rallies freely in recent years. Opposition groups claim that pro-Kremlin youth organisations have hired soccer fans and ultranationalists to carry out attacks on Kremlin critics.

Putin said that the rioting also underlined the need to protect the rights of every ethnic group and educate the population to fight xenophobia.