BAQUBA, Iraq (AFP) - Washington has declared the beheading of an American journalist a "terrorist attack", upping the stakes in its confrontation with the Islamic State of Iraq and Syria (ISIS) jihadist group, as Shi'ite militiamen gunned down 70 people at an Iraqi Sunni mosque.
The apparent revenge attack at the mosque in Diyala province on Friday will increase already significant anger among Iraq's Sunni Arab minority with the Shi'ite-led government, undermining an anti-militant drive that requires Sunni cooperation to succeed.
It came as the United States, which is carrying out airstrikes against ISIS, ramped up its rhetoric over the grisly killing of journalist James Foley, which was carried out by the jihadist group and shown in a video posted online.
In Washington, Deputy National Security Advisor Ben Rhodes said the beheading of Mr Foley "represents a terrorist attack against our country". Mr Rhodes also said that paying ransoms to free hostages is "not the right policy", confirming Washington's long-standing position amid claims from ISIS that other countries had paid to have their nationals freed.
In an unanimous statement on Friday, the United Nations Security Council strongly condemned Mr Foley's murder as "heinous and cowardly".
Army and police officers said the attack on the Musab bin Omair Mosque in Diyala Friday 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 machine gun fire, at 70 dead and 20 wounded.
Two officers had earlier blamed ISIS 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.
Mr 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.
"We found a massacre" at the mosque, he said.
Five vehicles with images of revered Shi'ite Imam Hussein were parked at the mosque, Mr Ali said, adding that residents clashed with the militiamen who withdrew when the Iraqi army arrived.
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.
US Vice-President Joe Biden said Friday that Washington would back a federal system in Iraq.
Writing in a Washington Post opinion piece, Mr Biden pointed to "functioning federalism" as an approach to breach the divisions in the country.
Mr Biden is a longtime supporter of the plan under which Iraq would be divided into three semi-autonomous regions for Shi'ites, Sunnis and Kurds, respectively.
Mr Biden also said the US was prepared to "further enhance" its support of Iraq's fight against ISIS.
The United States began an air campaign against ISIS in Iraq on April 8, and has since conducted 93 air strikes, including three against militants in the area of the Mosul dam, the country's largest, on Friday.
Pentagon chiefs warned of the dangers of ISIS and said operations against it in Syria may be needed.
"They marry ideology and a sophistication of strategic and tactical military prowess," US Defence Secretary Chuck Hagel.
"This is beyond anything we have seen."
General Martin Dempsey, chairman of the Joint Chiefs of Staff, spoke of a "very long contest" that could be won only with regional support and that of "the 20 million disenfranchised Sunnis that happen to reside between Damascus and Baghdad".
He was referring to the alienation of many Sunni Arab Muslims from Iraq's government and the Alawite-dominated regime in Syria.
US Secretary of State John Kerry, in a telephone call to Iraqi counterpart Hoshyar Zebari, offered his condolences for the "countless" Iraqis who have fallen victim to ISIS.
Both leaders "recognised that Iraq is on the front line in the war against ISIS and that Iraq, the United States, the region, and the international community must stand together to face this threat", according to the US State Department.
Mr Foley's killing has stoked Western fears that territory seized by the militants in Syria and Iraq could become a launchpad for a new round of global terror attacks.
The US State Department estimates that about 12,000 foreign fighters from at least 50 countries are in Syria.
Mr Foley, a 40-year-old freelance journalist, was kidnapped in northern Syria in November 2012. His employer GlobalPost said his captors had demanded a 100 million euro (S$ million) ransom.
GlobalPost chief executive Philip Balboni said his team had never taken the demand seriously, and US State Department deputy spokesman Marie Harf insisted: "We do not pay ransoms."
His captors had also sent Mr Foley's family a taunting and rambling e-mail threatening to kill him.
In the execution video, released online, a black-clad militant said Mr Foley was killed to avenge US air strikes against ISIS.
The man, speaking with a clear south London accent, paraded a second US reporter, Mr Steven Sotloff, in front of the camera and said he too would die unless US President Barack Obama changes course.