Iraqi officials said, Censor.NET reports citing Radio Free Europe/Radio Liberty.
Worshippers were gathered at the mosque, in a predominantly Sunni Muslim area, for prayers after breaking their fast during the holy month of Ramadan. IS has called on supporters to step up attacks during Ramadan.
There was no immediate claim of responsibility for the blast on June 27, the first in or around Baghdad since the government declared victory over Islamic State militants in Fallujah, further west, which was seen as a launchpad for such attacks.
On June 26, Iraqi forces declared Fallujah fully liberated from IS.
In one respect, the attack was not characteristic of IS, however, which generally hits Shi'ite targets in Iraq.