The violence came as U.S. Ambassador Zalmay Khalilzad warned that Iraq faces the possibility of sectarian civil war if efforts to build a national unity government do not succeed, and that such a conflict could affect the entire Middle East.
Police Lieutenant Colonel Falah al-Mohammedawi said the blasts occurred at the Buratha mosque, which is affiliated with the Supreme
Jalal Eddin al-Sagheer, the preacher at the mosque and one of the country's leading politicians, said there were three assailants. One came through the women's security checkpoint and blew up first, he said. One raced into the mosque's courtyard and other to his office before detonating themselves, said al-Sagheer, who was not injured.
He accused Sunni politicians and clerics of waging "a campaign of distortions and lies against the Buratha mosque, claiming that it includes Sunni prisoners and mass
graves of Sunnis."
"Shiites are the ones who are targeted as part of this dirty sectarian war waged against them as the world watches silently," He told Al-Arabiya television.
The attack occurred as worshippers were leaving at the end of Friday prayers, the main weekly religious service.
Earlier Friday, the Interior Ministry cautioned people in Baghdad to avoid crowds near mosques and markets due to a car bomb threat.
Rescuers carried the bodies from the mosque compound on makeshift wooden wheelbarrows and loaded them on the backs of pickup trucks. The Baghdad city council urged Iraqis to donate blood for those wounded.
On Thursday, a car bomb exploded about 300 yards (meters) from the Imam Ali mosque in Najaf, the most sacred shrine in Iraq for Shiite Muslims. Ten people were killed, police said.
'Explosion trying to provoke Iraqis'
The attacks were likely to increase tensions between Sunni and Shiite Muslims, already at a high level following the February 22 blast at a Shiite shrine in Samarra and reprisal killings. That bombing triggered a war of reprisal attacks against Sunni mosques and clerics.
"This explosion is trying to provoke Iraqis to sectarian sedition through bombing the mosques," Said Salah Abdul-Razzaq, a Baghdad city council member.
The Interior Ministry, which oversees police, said it received intelligence that insurgents were preparing to set off seven car bombs in Baghdad. Al-Mohammedawi said the alert will remain until the bombs are discovered and deactivated.
Security forces were searching the city, with orders to protect holy sites and be on the lookout for suspicious cars, the statement said. Citizens were urged to "be cautious, and to avoid gatherings or crowds while leaving markets, mosques and churches."
The statement also warned that legal measures would be taken against "any security official who fails to take the necessary procedures to foil any terrorist attack in his area."