Lawyers in Uganda are holding a one-day strike in protest at the recent deployment of troops at the High Court.
Lawyers are alarmed at the military's interest in the Besigye case
Some 100 lawyers gathered in black gowns and called on the attorney general to resign.
Soldiers in black T-shirts and wielding machine-guns were sent to a court where men accused of treason with opposition leader Kizza Besigye were appearing.
The deployment was widely condemned by lawyers and judges as an attack on the independence of Uganda's judiciary.
The government insists that there is nothing untoward - the strong security measures are needed against men accused of trying to topple President Yoweri Museveni.
The Ugandan Law Society wants to send out a message of disapproval of what they say is the undermining of the judiciary by the army.
Judges and lawyers were outraged at the presence of soldiers outside court
"[The attorney general] has failed to discharge his constitutional duty as the chief legal advisor to the government of Uganda and we are hereby calling upon him to resign," said Law Society President Moses Adriko.
He also criticised aspects of the military legal process, which Dr Besigye is also facing.
"It is unacceptable in a free and democratic society for armed men to intimidate or otherwise interfere with the due process of the law," he said.
In the coming days judges in the constitutional court will give a ruling on whether Dr Besigye's trial at both the High Court and the military court martial is legal.
The BBC's Will Ross in the capital, Kampala, says many Ugandans are increasingly concerned at the growing influence of the military.
Earlier this month, as 14 treason suspects were granted bail at the High Court, a group of heavily armed military men, since tagged the "Black Mambas Urban Hit Squad", surrounded the building.
Fearing the armed men, they opted to return to prison.
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 in High Court
Nov 2005: Charged with terrorism and unlawful possession of weapons in military court
Uganda's principal judge described it as a "despicable act" and a "rape" of the High Court and compared it to the days of Uganda's military ruler Idi Amin.
The following day the government said the military had been deployed to re-arrest the men, who were accused, along with Dr Besigye, of contacting Uganda's rebel groups.
The High Court has witnessed a great deal of drama in recent days.
On Friday Dr Besigye appeared there and was granted bail.
However, the army had earlier taken Dr Besigye to a military court martial where he was charged with additional offences, including terrorism.
His lawyers said that was aimed to ensure he remained in prison, whatever the High Court ruled.
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.
While the government says it has the evidence to prove Dr Besigye was involved in armed rebellion, the opposition says his arrest is political, and aimed at preventing him from standing against Mr Museveni in elections due early next year.