Baquba - Shi'ite militiamen gunned down 70 people at a Sunni mosque in the Hamreen area northeast of Baghdad on Friday, Iraqi officers and doctors said.
Army and police officers said the attack on the Musab bin Omair Mosque came after Shi'ite militiamen were killed in clashes, while other sources said it followed a roadside bomb near one of their patrols.
Doctors and the officers put the toll from the attack, in which worshippers were sprayed with machinegun fire, at 70 dead and 20 wounded.
Two officers had earlier blamed IS for the attack, but the preponderance of accounts point to Shi'ite militiamen.
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.
Ibrahim Aziz Ali, whose 25-year-old nephew was among those killed, told AFP he and other residents heard gunfire and rushed to the mosque, where they were fired on by snipers.
Five vehicles with images of revered Shi'ite Imam Hussein were parked at the mosque, Ali said, adding that residents clashed with the militiamen who withdrew when the Iraqi army arrived.
"We found a massacre" at the mosque, he said.
Ali said he hoped for justice from the courts, but if it is not forthcoming, "we will take our right by our hands."
Iraqi premier designate Haidar al-Abadi issued a statement calling for unity and condemning the killings, which may complicate the already-contentious process of forming the country's next government.