A suicide bomber in Iraq has blown himself up inside a Baghdad mosque, killing at least 29 people.
Officials said elderly men and children were among the casualties in the attack, which happened during prayers inside Umm al-Qura mosque in the western neighbourhood of al-Jamiaah.
Police said Khalid al-Fahdawi, a member of parliament, was also among the dead in the Sunday night attack that left 39 others wounded.
Ahmed Abdulghafur al-Samarrai, head of the mosque, said the suicide bomber walked up to a crowd, covered in bandages, detonating his explosives as the mosque chief was giving a speech.
Samarrai is known for his sermons against violent extremism and has received several threats against his life.
No group immediately claimed responsibility for the bombing, but Samarrai blamed the attack on al-Qaeda.
"I am sure al-Qaeda was behind this attack," he told Al-Sharqiyah television. "We will continue our fight against those criminals and unbelievers. They tried to drag the country into sectarian war before."
Major General Qassim al-Moussawi, a spokesman for the Iraqi capital's military operations command, raised the possibility that the bomber had inside help.
"For sure there must have been someone inside the mosque who helped the bomber. It must have been someone who is protecting the mosque," the AP news agency quoted him as saying.
The blast was quickly condemned by parliament speaker Osama al-Nujaifi, and Prime Minister Nouri al-Maliki called on Iraqis to stand strong against terrorists and "pursue them wherever they are".
"Solidarity and unity, and standing as one line behind the army and the police, are the only way to eliminate this danger, which does not differentiate between the Iraqis and targets all of us,'' al-Maliki said in a statement.
The blue-domed building is the largest Sunni mosque in Baghdad, and security there is provided by a government-supported group.
That the bomber detonated his explosives vest inside the mosque is particularly alarming as it is reminiscent of a 2006 attack on a shrine in the city of Samarra that fuelled widespread sectarian violence and brought Iraq to the brink of civil war.