BAGHDAD (Reuters) - Thirty-six men hanged in Iraq for a sectarian mass killing of soldiers were denied a proper legal defense at their trials and the executions appeared to have been “fueled by vengeance”, the United Nations said on Tuesday.

The hangings were carried out on Sunday at a prison in

southern Iraq, state TV said. Those executed were suspected Sunni Muslim militants convicted in the killings of as many as 1,700 soldiers, mostly Shi’ite Muslims, after they were taken captive by Islamic State insurgents two years ago.

“The individuals who have been executed were convicted only on the basis of information provided by secret informants or by confessions allegedly extracted under duress,” U.N. human rights spokeswoman Cecile Pouilly told reporters in Geneva.

She said the defendants’ court-appointed lawyer did not intervene during the proceedings apart from a three-minute statement just before the verdicts were delivered.

The United Nations, she said, had urged Iraqi authorities “to ensure that any trial conducted in connection with the massacre respects due process ... rather than be fueled by vengeance. Unfortunately, this (36 hangings) was not the case”.

In a recent report, Amnesty International said one of the hanged men had told its researchers that the defendants were beaten into making confessions, but that his complaint was ignored and not investigated.

“Defense lawyers appointed by the suspects’ families could not meet with or speak to the defendants before the hearing, so walked out, the families said,” Human Rights Watch said in a statement on Tuesday. “Subsequent state-appointed lawyers did not speak to their clients, according to the families.”

The soldiers were killed after Islamic State overran Camp Speicher, an ex-U.S. military base near Saddam Hussein’s home town of Tikrit, in 2014. U.S.-backed Iraqi government forces and Iranian-supported Shi’ite militias retook the region last year.

The Shi’ite-led government came under increased pressure from local Shi’ite politicians to execute militants sentenced to death after an Islamic State bombing killed at least 324 people in a Baghdad shopping street on July 3.

Justice Minister Haidar al-Zamili said on Sunday he expected more death sentences to be carried out over killings after Camp Speicher’s fall to Islamic State, dismissing U.N. and human rights groups concern over the fairness of the trials.

The truck bomb was the deadliest militant attack since the U.S.-led invasion that toppled Saddam in 2003.