Ten soldiers were sentenced to jail in South Sudan on Thursday for an attack on a hotel two years ago in which a local journalist was killed and five international aid workers were repeatedly raped.

The July 2016 attack at the Terrain hotel compound, on the outskirts of the capital Juba, was one of the worst incidents in a country where humanitarians are frequently targeted.

The attack came after clashes in Juba when a peace deal between the president, Salva Kiir, and his former deputy Riek Machar collapsed.

During chaotic fighting, government forces attacked the Terrain hotel compound housing some 50 employees of foreign organisations.

In his evidence at the start of the trial, the hotel’s British owner, Mike Woodward, said that “50 to 100 armed soldiers” broke into the compound.

Woodward described the actions of the soldiers, including “the gang-rape of at least five international women”, the murder of a South Sudanese journalist, the shooting of a US aid worker and “the beating and torture of almost every person in the entire building”, including mock executions.

Though hundreds of armed UN peacekeepers were stationed within a short drive of the compound, the organisation did not respond to repeated pleas for help.

A UN inquiry subsequently blamed a lack of leadership for a “chaotic and ineffective response”. The Kenyan commander of the UN force was removed.

The case was widely seen as a test of South Sudan’s ability to hold its soldiers to account during the five-year civil war, and diplomats and activists welcomed the outcome as rare positive news in a country that has suffered years of civil conflict, famine and disease.

Campaigners have urged the government to hold more trials, pointing out that few among the thousands of victims of systematic abuses across South Sudan have seen any form of justice.

Brig Gen Knight Briano found two soldiers guilty of the murder of the South Sudanese journalist John Gatluak Nhial and sentenced them to life imprisonment.

The judge found three other soldiers guilty of raping foreign aid workers, four guilty of sexual harassment and one guilty of theft and armed robbery. They received sentences ranging from seven to 14 years in jail.

One soldier was acquitted due to lack of evidence. Another died in jail during the trial.

A spokesman for South Sudan’s army said the trial would act as a deterrent to other soldiers while reassuring civilians that anyone who commited a crime would be punished.

Timeline South Sudan timeline Show

“This is important because the army has been accused of a great deal of rape, sexual harassment and all forms of violations, and it’s not part of our doctrine,” Col Domic Chol Santo said.

The judge ordered more than $2m (£1.5m) to be paid to the Terrain hotel for damages, $4,000 to each of five rape victims, $1,000 to an aid worker who was shot in the leg and 51 cattle to the family of the journalist who was killed.

“I am very happy! I won ... we won ... women won!” said one rape survivor who had returned to South Sudan to testify. “It is important to fight for our rights and never give up. We women have to still continue to fight for our rights that still in 2018 are trampled.”

The woman said she was “happy for all women in South Sudan and other parts of the world who don’t have voice. This trial can be a precedent for rape as war crimes.”

However, she said she found the compensation of $4,000 for each rape victim “offensive”.

In July, the UN accused South Sudanese government forces and allied militias of potential war crimes over a campaign of rape and killing that targeted civilians in opposition-held villages in the conflict-torn country.

According to the UN human rights office, at least 232 civilians were killed and 120 women and girls raped during an offensive between 16 April and 24 May in the country’s Unity state.

Among the victims was a six-year-old who investigators say was gang-raped by soldiers, and elderly and disabled villagers who were burned alive in their huts.

Some observers were critical of the fact that only low-ranked soldiers were tried.

“We continue to push for commanders to be held responsible and not only for the low-level people to be picked on,” said Andrew Clapham, of the UN Commission on Human Rights in South Sudan.

South Sudan’s civil war broke out in 2013, less than two years after the country had gained independence. The war has displaced a quarter of the country’s population of 12 million people, ruined the country’s agriculture and battered its economy.

The warring sides signed an initial agreement in June to end the fighting, but rebel leaders recently rejected some proposals such as having three different capitals in South Sudan to distribute power.