South Sudanese soldiers stand during their sentencing over the rape of foreign aid workers and the murder of a local journalist in an assault on the Terrain Hotel in the capital Juba in 2016. Picture: Andreea Campeanu/Reuters

Juba - A South Sudanese military court on Thursday sentenced 10 soldiers to prison for the rape of foreign aid workers and the murder of a journalist in an assault on a hotel in Juba in 2016, and ordered the government to pay compensation to the victims.

The attack, one of the worst on aid workers in South Sudan's civil war, took place on July 11, 2016, as President Salva Kiir's troops won a three-day battle in the capital over opposition forces loyal to ex-Vice President Riek Machar.

Witness accounts said that armed men attacked the Terrain Hotel for several hours. Victims phoned U.N. peacekeepers stationed a mile away and begged for help, but none came, the witnesses said.

The military head of the UN peacekeeping mission, Kenyan Lieutenant General Johnson Mogoa Kimani Ondieki, was fired over the incident.

The court case was widely seen as a test of will by the government of President Salva Kiir to bring accountability in the military that has long drawn accusations of widespread rights violations and a culture of impunity.

"The military court found that the accused here are guilty for their direct responsibility in committing crimes," said the head of the military court, Brigadier General Neath Almaz Juma, when reading the verdict.

A South Sudanese soldier is seen during his sentencing over the rape of foreign aid workers and the murder of a local journalist in an assault on the Terrain Hotel in Juba in 2016. Picture: Andreea Campeanu/Reuters

Ten soldiers were handed sentences ranging from seven years to life imprisonment. Eleven were on trial but one was set free due to the lack of charges against him.

Describing the incident, the manager of the Terrain Hotel, Mike Woodward, told the court that "between 50 and 100" soldiers arrived in the hotel in the afternoon of July 11 and began looting an hour later.

South Sudanese soldiers arrive for their sentencing over the rape of foreign aid workers and the murder of a local journalist in an assault on the Terrain Hotel in Juba in 2016. Picture: Andreea Campeanu/Reuters

"Five women working with humanitarian organisations were then raped. John Gatluak was shot at 6:15 p.m.," Woodward said, referring to the South Sudanese journalist who was killed. An American was also shot in the leg, he said.

An American, an Italian and a Dutch were among the rape victims. The court said the government must pay $4 000 to each of them.

It also ordered the government to pay 51 head of cattle to the relatives of the local journalist who was killed in the raid. The hotel owner is due to receive $2.2 million in compensation for the destruction and looting of his property.

A South Sudanese soldier is checked as he arrives for a sentencing over the rape of foreign aid workers and the murder of a local journalist in an assault on the Terrain Hotel in the capital Juba. Picture: Andreea Campeanu/Reuters

South Sudan's war broke out in December 2013, two years after it gained independence from Sudan, following a political disagreement between Kiir and his former deputy Riek Machar.

The violence, often fought along old ethnic rivalries, has killed tens of thousands and uprooted nearly a quarter of the country's population of 12 million.

As the violence intensified and spread, both local and international aid workers trying to deliver relief to the displaced faced increasingly deadly risks. Nearly 100 aid workers have been killed in the conflict since it started.