A separate attack at a funeral northeast of Baghdad killed another three people.
Police said the Baghdad blast went off around 10 p.m. near the gate of the Khalid bin al-Walid mosque in the capital’s southern Dora neighborhood, a largely Sunni Muslim area. It struck just after special late-evening prayers held during Ramadan ended.
At least 35 people were wounded in addition to those killed, police said. A hospital official confirmed the casualty toll.
Iraq is weathering its worst eruption of violence in half a decade, raising fears the country is heading back toward widespread sectarian fighting that peaked in 2006 and 2007. More than 2,600 people have been killed since the start of April.
The pace of the bloodshed has picked up since Ramadan began Wednesday, including a suicide bombing at a coffee shop in the northern city of Kirkuk late Friday that killed dozens.
In another attack Saturday, a suicide bomber blew himself up at a funeral in the town of al-Abbara, near the city of Baqouba, which is about 60 kilometers (35 miles) northeast of Baghdad. Police and hospital officials said that attack killed three and wounded 10.
All officials spoke on condition of anonymity because they weren’t authorized to release the information to journalists.
There has been no claim of responsibility for the recent wave of attacks.
Sunni extremists, including al-Qaida’s Iraq branch, frequently target Shiites, security forces and civil servants in an effort to undermine the Shiite-led government in Baghdad.
They also could be behind Saturday’s attack on the Sunni mosque, hoping that the bombing could spark a sectarian backlash against Shiites. But Shiite militias that have kept a low profile in recent years also could be to blame.
Attacks on Sunni places of worship have spiked in recent months as security has deteriorated and sectarian tensions grow.
Iraq’s minority Sunnis have been protesting for months against the Shiite-led government, alleging they receive second-class treatment. Sunni militant groups have tried to tap into that anger by linking their cause to that of the demonstrators.
Earlier in the day, authorities in Kirkuk, 290 kilometers (180 miles) north of Baghdad, ordered all cafes in that city to be temporarily shut down a day after a suicide attack there killed at least 39 people.
Kirkuk police chief Maj. Gen. Jamal Tahir said his officers could not guarantee the security of patrons at the dozens of teahouses and coffee shops scattered across the city. It is unclear when the shops will be allowed to reopen.
Kirkuk is a flashpoint for ethnic tensions, with its mix of Arabs, Kurds and Turkomen holding competing claims to control of the oil-rich area. The Kurds want to incorporate it into their self-ruled region in Iraq’s north, but Arabs and Turkomen are opposed.