Museveni, in power for 25 years, won 68 percent of the February 18 vote, with closest rival Kizza Besigye on 26 percent. Besigye said the polls were a sham due to widespread bribery, ballot box stuffing and intimidation.
Police said eight people had been arrested.
The protesters dispersed after police stepped in and the security forces then sealed off the streets around the shuttered market in the capital Kampala.
European Union observers, the African Union, the United States and Britain all criticised the poll but stopped short of condemning the result.
Police had warned that peaceful protests against the election outcome were illegal, saying the opposition intended to cause “widespread and sustained violence and destruction”.
Wednesday’s demonstration — not endorsed by Besigye — was called by Olara Otunnu, the fourth-placed candidate and leader of the Uganda Peoples Congress.
Otunnu led a crowd of about 80 people through the city before a larger group of several hundred gathered at the city’s Kisekka market — site of anti-government protests in the past.
Otunnu was not seen at the market.
Protestors danced, cheered and held up posters of Besigye, while shouting at passers-by to endorse the opposition during the hour-long protest.
“I am here because Museveni should resign,” 22-year-old motorbike-taxi driver, George Basasira, said. “He rigged the elections and he has been in power since before my birth.”
A number of people wearing yellow — the colour of Museveni’s ruling National Resistance Movement — had their clothes torn off by protestors.
Reuters witnesses saw several teargas canisters being fired at the crowd and live rounds being shot over protestors heads to break up the demonstration.
Police denied that live rounds were used.
“We did not need to use live rounds,” said police spokesman, Vincent Ssetake. “We fired teargas to restore order because the protestors were attacking people wearing yellow who they believed were Museveni supporters.”
Besigye and other opposition leaders have repeatedly warned Uganda is ripe for an Egypt-style uprising, though analysts question public appetite for unrest.
Besigye unsuccessfully appealed to the Supreme Court after losing the 2001 and 2006 elections. While judges agreed there had been vote-rigging and violence against the opposition, they said it had not changed the overall result. Reuters