At least 13 people have been killed in a suspected suicide bombing near
"Most of the dead were policemen," a security official said. More than 50 people were injured.
Torn police uniforms lay about the scene in
The mosque was the scene of a bloody siege that ended earlier in July with the deaths of more than 100 people.
A protest grew on Friday as students demanded the return of the mosque's surviving pro-Taleban cleric, Abdul Aziz, who is in detention.
Security forces initially stood by as the protesters emerged from the mosque chanting "[President Pervez] Musharraf is a dog!", and calling for an Islamic revolution.
But as angry demonstrators started hurling stones at police, officers in full riot gear were deployed and tear gas was fired.
The protesters daubed red paint over the mosque, which had been repainted in pale colors by the authorities after the end of the siege.
They wrote "Red Mosque" in large Urdu script on the dome of the building. They also raised a black flag with two crossed swords - meant to symbolize jihad, or holy war.
Calm shattered
Earlier protesters had prevented a government-appointed cleric from leading Friday prayers at what was supposed to be the peaceful re-opening of the mosque.
"I was told everything would be peaceful. I was never interested in taking up this job and after today I will never do it," Mohammad Ashfaq told AFP news agency as he left the mosque with a police escort.
The explosion took place in a restaurant outside the mosque soon after the protests were subdued by police, said the BBC's Dan Isaacs, who was only a short distance away.
It appeared to be targeted at the police cordon arranged round the mosque, where dozens of officers were lined up, he said.
A security official told the AFP news agency the bomb was set off by a suicide attacker.
"A man detonated explosives strapped to his body among two rows of
Officials said seven police officers were among the dead.
Centre of radicalism
Such a high-profile attack in the heart of the Pakistani capital will be extremely worrying for
Less than three weeks ago, troops stormed the mosque after its clerics and students waged an increasingly aggressive campaign to enforce strict Sharia law in
The mosque had become a centre of radical Islamic learning and housed several thousand male and female students in adjacent seminaries.
The chief of Dyala prison in
More than 100 people were killed in the siege including 11 soldiers and an as yet unknown number of extremists and their hostages.
More than 180 people have been killed in militant attacks in the past few weeks.
Also on Friday, a government spokesman in
PHOTO CAPTION
Protesters daub the Red Mosque