JUBA / WASHINGTON - A judge in South Sudan has sentenced South African citizen William John Endley to death by hanging, after he was charged with spying, illegal entry to South Sudan and conspiracy to overthrow President Salva Kiir's government.

Endley worked for rebel leader Riek Machar as a security adviser and was arrested in August 2016, days after fighting flared between government forces and Machar's bodyguards.

At the end of Endley's five-month trial, presiding Judge Ladu Armenio read his final ruling in Arabic and a court official translated it into English.

Armenio sentenced Endley to serve two consecutive prison terms of nine years and four months each, after which he will be hanged.

Endley has 17 days to appeal.

During the proceedings, it was reported to the court that Endley served as a major general while working for Machar's group, the SPLA-IO, and that he came to Juba with Machar in 2016 when Machar became first vice president, after the previous year's peace agreement.

The prosecution also told the court that Endley procured firearms and ammunition and helped the rebel movement with military expertise, which according to the court is a violation of the South Sudan National Security Act 2014 and South Sudan's Criminal Procedure Act.

Armenio said Endley's actions endangered state security and South Sudan's economy.

Endley's attorney, Gar Adel, rejected the court's ruling, noting that Endley's previous attorney had withdrawn from the case.

"The state was supposed to assign a lawyer temporarily. ... But he [Endley] had attended two sessions without a lawyer. When I came in, I lodged an application so that I was given time to talk to my client and to familiarize myself with the records, [but] the court refused," Adel told VOA's South Sudan in Focus.

Endley's first defense team was led by Monyluak Kuol Alor, who withdrew from the case a month ago, arguing that Endley should be freed under Article 8 of the Cessation of Hostilities Agreement, which was signed in December by the warring parties. The clause requires all sides in South Sudan to release prisoners of war and political detainees.

Endley first appeared in court in October with co-defendant James Gatdet Dak, Machar's spokesman. Two weeks ago, the court sentenced Gatdet to a 21-year jail term to be followed by death by hanging, sparking immediate condemnation from national and international human rights groups.

U.N. Mission in South Sudan chief David Shearer condemned the death sentences for Endley and Gatdet.

Family's reaction

Endley's sister, Charmaine Quinn, said her family in Cape Town was devastated by the news.

"We didn't expect this and we really are feeling very tired emotionally. We are really feeling so helpless," Quinn told South Sudan in Focus.

Quinn said she has not received any word from the South African Embassy in Juba regarding her brother's sentence.

She said her family has lodged concerns with the government in Johannesburg, which said the government would be releasing a statement soon, but that "it was just waiting for some information to come back."

Quinn said that in the beginning, when her brother was arrested, the family felt it was not getting enough assistance from the government. "Then they were able to help us establish that he was still alive and there was some assistance offered to us when he was ill, and we were able to send money to him and get parcels to him," she said.

She said she also has received phone calls from her brother.

Now that her brother's sentence has been finalized, Quinn said she is trying to stay positive that "the government will come on board and give us the assistance we have been asking for."

Quinn told VOA the family feels "the sentence is very unfair and we would like them to have the death penalty lifted, and with the appeal we would like to have him extradited back to South Africa" for a new trial.