Kizza Besigya arrested by police just before the end of the voting, which President Museveni is expected to win.
At least 30 people, including serving soldiers and an opposition MP, have been arrested on suspicion of plotting to overthrow Uganda’s government, the country’s army has said.
Army spokesman Colonel Paddy Ankunda told the AFP news agency on Friday that the group was suspected of planning an armed uprising against President Yoweri Museveni, himself a former rebel who seized power 30 years ago.
“We and the police are investigating the matter,” Ankunda said.
The detainees were “linked to a rebel group”, Ankunda added, declining, however, to give any further details.
He said most of those arrested were soldiers, adding that at least one member of parliament and one opposition politician had also been arrested.
The only detainee named by the spokesman was Michael Kabaziguruka, an MP from the main opposition Forum for Democratic Change (FDC) party, whose leader Kizza Besigye is in custody on treason charges.
Besigye, who cried foul after coming second to Museveni in February’s presidential election, was arrested last month for holding a mock swearing-in ceremony.
He was previously charged with treason in 2005 but the case was eventually abandoned.
FDC spokesman Ssemujju Nganda went to visit Kabaziguruka after his arrest.
“He told me he was questioned on rebel links, which he didn’t know about,” said Nganda, adding that other party supporters “are under detention on the same claim”.
A long-standing opponent of Museveni, Besigye has been frequently jailed, placed under house arrest, accused of both treason and rape, tear-gassed, beaten and hospitalised over the years.
In a separate development, Ankunda said Uganda plans to withdraw its troops from a mission in Central African Republic whose goal is to hunt down members of the Lord’s Resistance Army (LRA) rebel group.
Ankunda told AP news agency that the rebel group no longer poses a threat to Uganda.
He said authorities have notified the African Union of plans to withdraw the troops before the end of this year.
About 2,500 Ugandan soldiers are operating in the jungles of Central African Republic under the AU mission. They are supported by US special forces.
Joseph Kony, the LRA leader, is wanted by the International Criminal Court for crimes against humanity. The group is infamous for recruiting boys to fight and taking girls as sex slaves.