Kizza Besigye has been arrested on many occasions in past but this is the first time during this election campaign.
Mr Besigye has since lost three disputed elections against the long-time leader Yoweri Musevini.
Mr Museveni, 71, has been in power for 30 years and is running for a fifth term in office.
Meanwhile, Ugandan police have been deployed in downtown Kampala to disperse supporters of leading opposition presidential candidate, Kizza Besigye.
They have also ordered businesses to shut.
Mr Besgjye and six other candidates are running against President Yoweri, who is seeking to extend his 30-year rule, in Thursday’s election
The BBC’s Catherine Byaruhanga reports that Mr Besigye’s car was driving along one of main highways in Uganda’s capital, Kampala, and escorted by hundreds of supporters. Witnesses say teargas was fired to disperse the crowd.
People shielded the opposition candidate after tear gas was fired in the crowd
The police have told our correspondent that he is not under arrest but is being held because he disobeyed orders not to disrupt city traffic.
They say he should be released soon and taken to his next rally, she adds.
Mr Besigye used to be President Museveni’s personal doctor, but he went on to become his political opponent and has referred to him as a “dictator”.