JUBA: South Sudan on Friday released four top leaders accused of rebellion and treason, dropping charges for attempting to overthrow the government in a move aimed at ending a four-month-old civil war.
President Salva Kiir said their release was the "price of peace", adding: "Even if we hang them they cannot compensate those who were killed."
The court order said the men were released "in order to promote peace and reconciliation among our people", while Kiir urged people to respect those released.
"This is the only way of getting out (of war)," he said in a speech. "Let's all work together."
An AFP reporter at the court said the four men were greeted by cheering supporters who lifted them up on to their shoulders into the crowd.
"We were imprisoned without any reason," said freed detainee Pagan Amum, the former secretary general of the ruling party.
In a speech thanking his supporters, he vowed to work to end the vicious conflict.
"We have to return South Sudan to peace and stability," Amum said, adding he would work with both the government and rebels "to end this senseless war that is killing our people."
But Kiir has also ordered the four to remain in the country, warning that they can be "recalled back if the criminal procedures are reviewed".
The detention of the four had been a major sticking point in peace talks, and the gesture comes as the leaders on both sides of the conflict face the threat of UN sanctions amid worsening violence and atrocities.
Amid a wave of killings, UN human rights chief Navi Pillay is heading to the country on Monday on a joint mission with Adama Dieng, the UN's special envoy for the prevention of genocide.
The conflict has already left thousands of people dead, over a million displaced, and prompted UN warnings of the risk of famine.
The three other freed detainees are ex-national security minister Oyai Deng Ajak, former ambassador to the US Ezekiel Lol Gatkuoth, and ex-deputy defence minister Majak D'Agoot.
"We feel that our clients have been vindicated, they are innocent people," defence lawyer Monyluak Alor told AFP.
"They were witch hunted, but then justice has prevailed... peace and reconciliation are paramount now."
The four leaders were arrested in Juba in December after fighting broke out between members of the presidential guard. The fighting rapidly escalated into all-out war between troops loyal to Kiir and defectors and ethnic militia loyal to sacked vice president Riek Machar.
Kiir accused Machar and his allies of attempting a coup, and initially 11 of his loyalists were put on trial.
Machar denied the allegation, and in turn has branded Kiir a "genocidal leader" who started the war by carrying out a purge.
Charges remain against Machar, who fled the capital and is leading the rebellion, as well as other two key rebels, former governor of the oil-rich Unity state Taban Deng, and ex-minister Alfred Ladu Gore.
However, charges were also dropped against seven leaders who were arrested shortly after fighting broke out but released in January into the care of neighbouring Kenya.
The move comes amid worsening violence in South Sudan, the world's newest nation which only won independence from Khartoum in 2011.
Both sides have also been implicated in atrocities and war crimes, and fighting has intensified with the rebels saying they are closing in on northern oil fields and several key towns.
Violence has also taken on an ethnic dimension, pitting Kiir's Dinka tribe against militia forces from Machar's Nuer people.
Last week the rebels were accused of murdering hundreds of civilians after capturing the oil hub of Bentiu, and a mob killed dozens of civilians in an attack on a UN base in Bor where they were sheltering.