Ugandan opposition leader Kizza Besigye has appeared in the High Court to sign bail papers, but then returned to jail.
The Kizza Besigye arrest has fuelled street protests
He is charged with treason, but is also accused of terrorism in a military court for which he is now being held.
A constitutional court is now to decide whether it's legal for the two courts to try him simultaneously.
Dr Besigye's supporters say the charges are politically motivated, ahead of presidential elections next March, which President Yoweri Museveni denies.
Journalists and diplomats were barred from the heavily guarded courtroom in the capital, Kampala, a day after lawyer went on strike for a day in protest at the recent deployment of troops to the High Court.
"As far as we are concerned, Besigye has signed his bail papers and he is a free man now," Dr Besigye's lawyer Yusuf Nsibambi told AFP.
But he said that the prison had issued a warrant that Dr Besigye remain in prison because of charges facing in a military tribunal.
"We are going to challenge the warrant because the military court is subordinate to the High Court," he said.
There was a heavy security presence outside the court
Dr Besigye, the leader of the Forum for Democratic Change (FDC), was arrested three weeks after he returned from exile last month.
The BBC's Will Ross in the capital, Kampala, says many Ugandans are increasingly concerned at the growing influence of the military
Dr Besigye's arrest and trial in two courts has been widely condemned. UK Prime Minister Tony Blair has said that events in Uganda have caused his government a great deal of concern.
The day before Dr Besigye was taken to a military court martial, two British ministers were reportedly assured by President Museveni that his political rival would not be arrested by the military.