A second suicide attacker at the mosque in al-Radwaniya district was shot and killed by security forces before he could set off his explosives, the police sources said.
A separate bomb went off in the district of Abu Ghraib, west of Baghdad, killing two and wounding nine, security and medical sources said.
Islamic State was behind the larger attack, which also wounded at least 25 others, according to Amaq news agency, which supports the group. There was no immediate claim of responsibility for the second blast.
The rise of the ultra-hardline Sunni Muslim group, which is battling government forces over control of vast territory in northern and western Iraq, has exacerbated a long-running sectarian conflict, mostly between Shi’ites and Sunnis, that emerged after the US-led invasion in 2003.
The Iraqi government has retaken several major cities from Islamic State in the past year and slowly pushed the militants back toward the Syrian border. The authorities have said they want to recapture the northern city of Mosul this year, but Iraqi officials privately question whether that is possible.