The shooting in the Hamreen area of Diyala province will increase already significant anger among Iraq's Sunni Arab minority with the Shiite-led government, undermining an anti-militant drive that ultimately requires Sunni cooperation to succeed.
It came as government forces battled to regain ground in Diyala, and Washington warned of the dangers of the Islamic State (IS) jihadist group, which spearheaded an offensive that overran swathes of Iraq in June, and this week released a video of American journalist James Foley being beheaded.
Doctors and the officers put the toll from the attack, in which worshippers were sprayed with machinegun fire, at 70 dead and 20 wounded.
The government turned to militiamen to bolster its flagging forces during the IS offensive, sparking a resurgence of groups involved in brutal sectarian killings in past years that will be difficult to dislodge.
Also Read
Elsewhere in Diyala, Kurdish and federal security forces today launched an operation aimed at retaking the Jalawla area from militants who seized it on August 11.
Pentagon chiefs, meanwhile, warned of the dangers of IS and said operations against it in Syria may be needed, as the West reeled from Foley's grisly killing.
"They marry ideology and a sophistication of strategic and tactical military prowess," US Defence Secretary Chuck Hagel said of the "barbaric" militants.
"They are tremendously well funded. This is beyond anything we have seen."
General Martin Dempsey, chairman of the Joint Chiefs of Staff, said the group "has an apocalyptic end of days strategic vision that will eventually have to be defeated".