Uganda's former intelligence chief, who is a strong critic of President Yoweri Museveni, has been charged with insubordination at a military court.
Gen David Sejusa is accused of going to political rallies against the orders of the chief of defence forces, reports the state-owned New Vision newspaper.
Gen Sejusa denied the charges, reports the private Daily Monitor newspaper.
President Museveni, who has been in power for 30 years, is standing for re-election on 18 February.
Other charges against Gen Sejusa, who was arrested on Sunday, include absence without official leave and participating in partisan political activities.
A lawyer for Gen Sejusa, David Mushabe, said he was a "prisoner of conscience"' who had been targeted for calling Mr Museveni a dictator, Associated Press news agency reports.
His supporters said he was arrested ahead of presidential elections because the government was worried he would mobilise Ugandans to protest in the event the poll was rigged, it reports.
"Gen Sejusa is fully aware that it will be the people of Uganda who will free him from bondage,'' pro-democracy group Free Uganda is quoted as saying.
He went into exile in the UK in May 2013 after claiming that Mr Museveni was creating a "political dynasty" in Uganda, and grooming his son to succeed him.
He returned to Uganda 18 months later.
Seven candidates, including former Prime Minister Amama Mbabazi, are challenging Mr Museveni for the presidency in the fiercely contested election.