Iraqi Prime Minister Haider Al Abadi has ordered the immediate execution of hundreds of extremist militants on death row in retaliation for ISIS killing eight captives whose bodies were found on Wednesday.
Mr Al Abadi, who has been accused of failing to respond in force to ISIS, ordered "the immediate punishment of terrorists condemned to death whose sentences have passed the decisive stage", his office said, referring to convicts whose appeals have been exhausted.
No date was announced for the start of any mass hangings.
More than 300 people, including around 100 foreign women, have been condemned to death in Iraq and hundreds of others to life imprisonment for membership of ISIS, a judicial source said in April.
Most of the convicted women are Turkish or from former Soviet republics, while a Russian man and a Belgian national are also on death row.
Mr Al Abadi vowed to avenge the deaths of the eight ISIS captives, a day after their bodies were found along a highway north of Baghdad.
"Our security and military forces will take forceful revenge against these terrorist cells," he told senior military officials and ministers.
"We promise that we will kill or arrest those who committed this crime," he said.
The corpses, found at Tel Sharaf in Salaheddin province, were decomposing and had been strapped with explosive vests, the army said.
They included six hostages who had appeared in an ISIS video with badly bruised faces. ISIS claimed they were Iraqi police officers or members of the Hashed Al Shaabi paramilitary force which was key to the group's defeat.
In the video posted online on Saturday by the Amaq propaganda outlet of ISIS, the militants threatened to execute their captives unless Baghdad released Sunni Muslim women held in its prisons within three days.
But Mr Al Abadi said autopsies indicated the captives were already dead when the recording was posted and that "the terrorists posted the video to try to dupe us".
Iraqi security forces "will also find out who passed on information to the terrorist cell", he pledged.
The change of tone from the prime minister came after criticism on social media of his failure to react forcefully to the grisly discovery.
Iraq declared victory over ISIS in December after expelling the extremist group from all urban centres in a vast military campaign.
But the Iraqi military has kept up operations targeting mostly desert areas along the porous border with Syria.
Iraq, which has repeatedly faced criticism over the high number of death sentences handed down by its anti-terrorist courts, hanged at least 111 convicts in 2017.
About 20,000 people were arrested in the three-year battle with ISIS, which had seized swathes of western and northern Iraq in 2014.
Human Rights Watch last week urged Iraq's judiciary to deal with foreign women and children affiliated with ISIS on a case-by-case basis instead of slapping them with "one size fits all" sentences.
Since January, HRW said Iraq's judiciary had "proceeded with rushed trials against foreigners on charges of illegal entry and membership in or assistance" to the group.
Most foreign women had been sentenced to death or life in prison and children aged nine and above to between five and 15 years in jail for taking part in violent acts, it said.
The New York-based watchdog called on Iraq "to take into account their individual circumstances and actions and give priority to prosecuting the most serious crimes while exploring alternatives for lesser ones".