An army officer and a police officer said a suicide bomber first broke into the Musab bin Omair Mosque in Imam Wais village in Diyala province, some 120 kilometres northeast of Baghdad, detonating his explosives before gunmen rushed in and opened fire on worshippers.
The officials said that fighters with the Islamic State group have been trying to convince members of two prominent local Sunni tribes the Oal-Waisi and al-Jabour to join them but they have thus far refused.
Since early this year, Iraq has been facing an onslaught by the extremist Islamic State group and allied Sunni militants across much of the country's north and west. The crisis has worsened since June as the militant fighters swept through new towns in the north, killing dozens of people and displacing hundreds of thousands, mainly members of the minority Christian and Yazidi religious communities.
Iraq's most influential Shiite cleric has called on the country's leaders to settle their differences in a "realistic and doable" manner and swiftly form a new government, amid the growing Sunni insurgency that threatens to break up the country.
Grand Ayatollah Ali al-Sistani said the next government should be made up of candidates who care about "the country's future and its citizens" regardless of their ethnic and religious affiliations. Al-Sistani warned that that politicians' "demands and conditions could derail the forming of the new government.