Kizza Besigye was arrested yesterday in Kampala, where he is holding his last rallies ahead of elections on Thursday.
Police took Mr Besigye away on a truck as he tried to address a crowd. They also fired tear gas.
Mr Besigye is a four-time presidential candidate who used to be Ugandan president Yoweri Museveni’s personal physician. Mr Besigye broke ranks with Mr Museveni 15 years ago, saying that Mr Museveni was no longer a democrat.
Recent opinion polls show Mr Museveni in a tight race with Mr Besigye, who is promising to run a more efficient government.
Ahead of elections, there has been a substantial rise in the number of police deployed around Kampala, which is seen as an opposition stronghold.
Mr Museveni says he will deploy the military to protect the peace during the elections and has pledged to “smash” those who threaten national security.
“The bottom line is no-one can play around with the security of Uganda when I am president,” the 71-year-old leader said.
Critics and opposition activists are concerned the military will be used to intimidate opposition supporters during and after the elections.
Uganda has not had a peaceful transfer of power since the country’s independence from Britain in 1962. Mr Museveni himself took power by force in 1986.
The US is urging the government and electoral authorities “to ensure a level playing field and transparent process, including through fair application of the law, so that all candidates have an equal opportunity to express their views and voters have the opportunity to hear them”.
The vote on Thursday is for presidential, parliamentary and local elections, in the third polls since the restoration of multiparty politics in 2005.