Museveni made the remarks on Saturday at State House Entebbe while meeting members of the Inter Party Organization for Dialogue (IPOD), a forum of political parties represented in parliament.
Museveni said he's optimistic that if he garners support from political parties, political violence and commercialisation of politics will be no more.
"I urged leaders of the opposition political parties, together with their supporters, to work with the National Resistance Movement (NRM) government to eradicate electoral violence and the monetization of politics to give democracy and stability a chance to flourish in Uganda," Museveni said in a short statement.
He added; "If you want democracy and stability, do not tolerate electoral violence and money. Electoral violence is a big shame. It must not be tolerated. I was working on stopping electoral violence myself. But if I get support we shall eradicate it."
In the past months, there has been violence especially during by-elections. In the Arua by-election, more than 30 opposition politicians including members of parliament were arrested and some tortured by security agencies on the last day of campaigns.
The arrests were triggered by the alleged stoning of one of Museveni's vehicles as he left the venue where he was campaigning for the NRM candidate. Kyadondo East MP Robert Kyagulanyi's driver, Yasin Kawuma was shot dead during a state crackdown. Similarly, earlier in the Bugiri by-election, one person was also shot dead by suspected state operatives.
The IPOD delegation to State House was led by its chairperson Fred Ebil, the secretary general of Uganda People's Congress (UPC). Others were NRM secretary general Justine Kasule Lumumba and her deputy Richard Todwong, JEEMA secretary general Fredrick Kasajja and Democratic Party secretary general Dr Gerald Siranda. The meeting was also attended by Prime Minister Ruhakana Rugunda.
However, it was shunned by Forum for Democratic Change. FDC vice president for eastern Uganda Salaam Musumba said that she hadn't been authorised by the party leadership to go to State House. Musumba had however attended an earlier meeting at the NRM party headquarters on Kyaddondo road.
Lumumba said that Museveni, the chairman of NRM party could not meet them at party offices because he had officials guests at State House. This is not the first time FDC is shunning IPOD meetings at State House, insisting that the State House, being a government facility shouldn't be used for party activities.
In 2016, the party under its former president Mugisha Muntu said that they were comfortable meeting Museveni in any other place but not at State House.