First ICC accused - DR Congo's Lubanga - 'to be freed'
Judges at the International Criminal Court in The Hague have ordered the accused in its first case - Thomas Lubanga from Democratic Republic of Congo - to be freed.
However, he will not be released for at least five days, while the prosecution considers whether to appeal.
The trial was suspended last week after judges cited procedural irregularities.
Mr Lubanga has pleaded not guilty to charges of recruiting child soldiers.
The office of the prosecutor - Luis Moreno-Ocampo - was found to have not identified a key witness.
Judge Adrian Fulford said Mr Lubanga should be "freed without condition", saying his detention was "no longer fair" after the trial was suspended.
In their ruling, the judges said: "An accused cannot be held in preventative custody on a speculative basis, namely that at some stage in the future the proceedings may be resurrected."
However, the prosecution has five days to seek an appeal and, if the challenge is accepted, Mr Lubanga will remain in detention until that appeal is heard, the ICC said in a statement.
It is understood that the prosecution will appeal.
The trial of Mr Lubanga, which opened in 2009 after a seven-month delay over disputed confidential evidence, has been plagued by legal challenges.
The first witness at the trial retracted his testimony after first saying he had been recruited by Mr Lubanga's fighters on his way home from school.
One of the problems facing the court is that Bunia - the capital of the Ituri region where Mr Lubanga was a rebel leader - was still considered a conflict zone.
This meant the safety of potential witnesses could not be guaranteed.
Mr Lubanga led the Union of Congolese Patriots (UPC), an ethnic Hema militia - one of six groups that fought for control of the gold-rich Ituri region from 1999 until 2003.
The land struggle turned into an inter-ethnic war in which an estimated 50,000 people were killed and hundreds of thousands were left homeless.