Uganda's main opposition leader was freed Tuesday after spending two months in jail over treason charges after he claimed an election victory over the country's long-time president.

A Ugandan judge freed Kizza Besigye on bail, rejecting prosecutors' calls for him to be remanded indefinitely until his case is concluded. Besigye was arrested May 11 ahead of the inauguration of President Yoweri Museveni.

Besigye on Tuesday waved to chanting supporters in a packed courtroom when the judge ordered his release. Besigye told reporters that he did not know how long his freedom would last. He was then driven to his home on the outskirts of the capital, Kampala, under police escort.

Besigye, a four-time presidential candidate, has been arrested several times over the years. He has never been convicted of a crime.

Besigye insists he won a presidential election held in February. According to official results, Museveni won with over 60 percent of the votes. Election observers said the polls were marked by many irregularities, but Uganda's top court said those failures were not substantial enough to affect the final outcome.

Besigye declared a defiance campaign, urging his supporters to protest what he called a fraudulent victory for Museveni.

Museveni has held the presidency here since 1986, when he took power by force. Besigye, a retired army colonel and medical doctor who once served as Museveni's physician, held various government and military posts before falling out with Museveni in 1999 and then running against him in 2001.

Besigye now describes Museveni as a dictator.