The International Criminal Court has suspended the release of the accused in its first case, Thomas Lubanga from the Democratic Republic of Congo.
Prosecutors have appealed against the court's decision to release him after his trial was suspended last week.
Mr Lubanga has pleaded not guilty to charges of recruiting child soldiers in eastern Congo in 2002-03.
He will remain in custody until judges rule on his appeal, the court said.
Mr Lubanga's trial was suspended two weeks ago after judges cited procedural irregularities.
The judges ruled that it was "no longer fair" to keep Mr Lubanga in detention.
Prosecutors appealed against that decision.
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 - is still unstable.
This means the safety of potential witnesses cannot 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.