Other violence, mostly sectarian, across Iraq left a total of 41 dead.
It was unknown who carried out the attack in the mixed Tunis neighborhood, but it bore the markings of sectarian violence. The mosque is near the Sunni Arab stronghold of Azamiyah and Lieutenant Colonel Falah al-Mohamedawi of the Interior Ministry said it occurred hours before the 11pm Baghdad curfew.
An hour later, police said a roadside bomb exploded outside a bakery in southeast Baghdad, killing three bystanders and wounding 12.
Another five people died earlier when a car bomb exploded at the entrance to a police station in Baghdad's biggest Shia neighborhood.
Violence has been steady around Iraq and dozens have died almost every day in the weeks leading up to the formation of Iraq's new unity government
The swearing in Saturday of Shia Prime Minister Nouri al-Maliki's new government again brought to the forefront the possibility that some foreign troops could start packing for home within months, an idea quickly shot down in Washington.
Parliament to meet Sunday
Al-Maliki reportedly spent much of the day at his office in the heavily fortified Green Zone meeting with advisers and discussing possible candidates for the defense and interior ministries - two key posts that did not get permanent appointments when the government took office.
Parliament did not convene as deputies asked for time to examine the nuts and bolts of running the chamber and the procedures for setting up committees. They decided to convene the 275-member body on Sunday. Al-Maliki has also said he would need about a week to choose men for the two security posts, and they would need to be sworn in by parliament.
Lawlessness is sweeping much of
Al-Maliki was has vowed to used maximum force against those responsible for the daily violence.
In Samarra, 95 km (60 miles) north of Baghdad, gunmen attacked a city councilor and, in the ensuing firefight, two gunmen and a bodyguard were killed, police said.
The US military said on Tuesday that it had killed a number of insurgents during a joint operation with Iraqi soldiers in Samarra. It said Monday's raid resulted «in the deaths and detention of several terrorist operatives,» but did not provide a number.
It added that "a young girl - a daughter of one of the terrorists - was inadvertently killed by Coalition Forces" during the raid. The military said it regretted the death and that the unit commander would conduct an investigation.
A car bomb exploded in the late afternoon and killed five people and injured 16 outside a police station in Baghdad's Sadr City, a sprawling Shia district in northeast Baghdad, police said.
Earlier, gunmen killed four ironsmiths and wounded one as they were riding a pickup to work in northern Mosul, police said.
In another drive-by shooting, attackers killed three Iraqi day laborers and wounded four as they drove by a minibus to work at a farm near Baqouba, 60 km (35 miles) northeast of Baghdad. Police said the casualties, all Shias, appeared to be the latest victims of sectarian attacks by minority Sunni Arabs in Diyala province.
A few hours later, gunmen in a car killed three Iraqi men standing near a house in Baqouba, police said. A schoolteacher was gunned down in northern Kirkuk.
In New Baghdad, a bomb killed two police commandos and three civilians. The attack, which damaged nearby shops and cars, also wounded eight Iraqis: five commandos and three civilians.
A roadside bomb hit a minibus carrying workers to a textile factory in western Baghdad, killing one and wounding three others, said police First Lieutenant Maithem Abdel-Razaq
In western Baghdad, a drive-by shooting killed a streetside cigarette vendor.
Fighter sentenced to die
An Iraqi court sentenced a man to death for leading a cell accused of attacks on the security forces, the US military said on Tuesday.
Mahdi Ahmed al-Juburi was found guilty last week by the Central Criminal Court of Iraq, together with 11 other fighters. Four of them were jailed for life.
Al-Juburi led a cell in the northern city of Mosul and reportedly admitted to conducting operations against Iraqi security forces.
The US military said in a statement: "The defendant believes in killing coalition forces, Iraqi police and Iraqi National Guard members because he says they are not enforcing God's will.
"The defendant has regularly kidnapped people, interrogated them and then killed them, frequently in front of their families."
He also allegedly confessed to killing an army colonel.
The four men sentenced to life had been arrested by US-led forces after a search of their house found a badly beaten Egyptian who had been held for the past 18 days, and a large number of weapons.
The remaining trials involved sentences ranging from two to 10 years for cases of weapons possession and illegal entry into Iraq.