A court in Uganda has ordered the release of one of the commanders of the Lord's Resistance Army (LRA), ending the country's first war crimes trial.
Thomas Kwoyelo had been charged with 53 counts of murder and other crimes.
But the constitutional court said he should be given an amnesty in line with other LRA rebels.
At least 30,000 people died as the rebel movement spread terror in northern Uganda for more than 20 years, displacing some two million people.
It is notorious for kidnapping children and forcing the boys to become fighters and using girls as sex slaves.
The group is listed by the US as a terrorist organisation and now operates mainly in neighbouring countries such as Democratic Republic of Congo, South Sudan and Central Africa Republic
Mr Kwoyelo was captured more than two years ago in DR Congo during a Ugandan military operation.
The BBC's Joshua Mmali in the capital, Kampala says he was a former LRA colonel and said to be the fourth in command at the time.
He was charged with leading raids into villages in northern Uganda and DR Congo between 1992 and 2005, killing and abducting civilians - charges he denied.
'Off the hook'
Mr Kwoyelo was the first LRA commander to face trial in Uganda's special war crimes court.
It was set up in 2008, following peace talks between the government and the LRA, which later collapsed.
The government assured the LRA that its fighters would be tried by Ugandan courts, rather than the International Criminal Court (ICC).
Mr Kwoyelo asked to be released on the grounds that other LRA rebels have been granted an amnesty.
"He is off the hook," said his defence lawyer Ben Ikilai. "The constitutional court has decided that he is supposed to be released because it was discriminatory not to grant him an amnesty."
The LRA leader, Joseph Kony, is still at large.
He and his close aides have been wanted by the ICC since 2005 for rape, murder, mutilation and forcibly recruiting child soldiers.
He refused to sign a peace deal with the Ugandan government in 2008 when it could not guarantee the withdrawal of the ICC arrest warrants.