Eighteen men charged with treason along with Ugandan opposition leader Kizza Besigye have been taken to a military court on terrorism and weapons charges.
Dr Besigye (right) denies the alleged links to rebel groups
The men refused to enter a plea, saying a military court had no jurisdiction.
But army officials insisted that anyone found in possession of a weapon would be treated like a soldier.
Dr Besigye's arrest on Monday sparked two days of rioting. He is seen as the strongest challenger to President Yoweri Museveni in polls due in 2006.
The ruling National Resistance Movement is expected to officially nominate Mr Museveni as its candidate later on Friday.
Earlier this year, the United Kingdom and other donors withheld some aid to Uganda after the constitution was amended to allow Mr Museveni to run for a third term.
Dr Besigye may be taken to the High Court on Friday for a bail hearing after not appearing as expected earlier in the week.
Army spokesman Maj Felix Kulayigye refused to say whether Dr Besigye, a retired colonel, could also face military charges.
Officials say the court martial will only start after the end of the civil trial.
Meanwhile, Uganda's chief justice has condemned the appearance of dozens of armed men, apparently soldiers wearing black T-shirts, outside court on Wednesday.
Used to be Museveni's doctor
March 2001: Ran against Museveni
August 2001: Went into exile
Oct 2005: Returned home
Nov 2005: Charged with treason, rape
"The whole world is looking at us and we have to show maximum political maturity so that we are able to say with confidence and pride that we are a modern democratic nation cherishing the value of human rights and accommodating all shades of opinion as well aspirations of our people," Benjamin Odoki said.
Fourteen of the accused were granted bail but they refused to leave the court, saying they were afraid of the men.
Overnight, Ugandan police raided the offices of the Daily Monitor newspaper, looking for the source of posters seeking donations for Dr Besigye's legal defence fund.
Managing director Conrad Nkutu told the BBC that 20 armed police searched the premises, saying the posters were illegally raising funds.
The Monitor has carried an advertisement asking people to contribute to a legal defence fund for Dr Besigye but Mr Nkutu said he was not aware of how this could break the law.
The chief justice condemned the presence of the armed men at court
The paper and its sister radio station have frequently been criticised by the government and earlier this week, there were reports that the authorities were considering closing the paper down over its reports on the military.
On Thursday, the United States called for a fair and speedy trial for Dr Besigye which does not affect the elections.
It said it was "deeply concerned" about his arrest .
Dr Besigye's wife Winnie Banyima, a former MP, told the BBC she thought the charges against her husband were "trumped up" and said he had suffered intimidation since he declared his intention to challenge the president before polls five years ago.
Once Mr Museveni's doctor, Dr Besigye ran against the president in 2001 before fleeing after the elections, saying his life was in danger.
Dr Besigye returned from four years of exile last month to large crowds of cheering supporters.
If found guilty of treason, he and 22 co-accused could face the death penalty.
Dr Besigye has previously denied allegations that he is linked to rebel groups.
He was also charged with rape dating from 1997, allegedly involving the daughter of a friend.