Prime Minister Haider al-Abadi recently declared victory against the Islamic State group

The UN on Friday harshly criticised the mass-hanging of 38 men at a prison in southern Iraq this week, urging Baghdad to immediately halt all executions.

Iraq on Thursday hanged 38 jihadists belonging to the Islamic State group or Al-Qaeda for terrorism offences at a prison in the southern city of Nasiriyah, according to provincial authorities.

It was the largest number of executions in Iraq on a single day since September 25, when 42 people were put to death in the same prison.

"We are deeply shocked and appalled at the mass execution on Thursday," United Nations human rights office spokeswoman Liz Throssell told reporters in Geneva.

The hangings, she warned, "once again raises huge concerns about the use of the death penalty in the country".

The UN had determined that all of the 38 executed prisoners were men and had been convicted for terrorism-related crimes, but could say nothing more about their identities, she said.

A prison source however told AFP that they were all Iraqis, but that one also held Swedish nationality.

The executions came after Prime Minister Haider al-Abadi on Saturday declared victory against the Islamic State group after a three-year campaign by government forces backed by a US-led coalition to retake territory seized by the jihadists.

The UN and rights watchdog Amnesty International have repeatedly voiced concerns about the use of the death penalty in Iraq, which ranks among the world's top executioners, after China, Iran and Saudi Arabia.

"Given the flaws of the Iraqi justice system, it appears extremely doubtful that strict due process and fair trial guarantees were followed in these 38 cases," Throssell warned.

"This raises the prospect of irreversible miscarriages of justice and violations of the right to life," she said.

The UN has learned of 106 executions in Iraq so far this year, including the mass-hangings in September.

"We once again urge the Iraqi authorities to halt all executions, establish an immediate moratorium on the use of the death penalty and carry out an urgent and comprehensive review of the criminal justice system," Throssell said.