Museveni accuses Facebook of arrogance and bias
Mr Museveni, dressed in a military jacket, said in a televised speech that he would not accept anybody playing with the country or deciding which political candidates were good or bad.
He said that if Facebook was to operate in Uganda, it should be used equitably by everyone.
On Tuesday, Uganda's communications regulator told telecoms firms to block access to social media and messaging apps, hours after Facebook had closed "fake" accounts it said were linked to the government.
Facebook said the accounts were being used to manipulate public debate in the highly hotly contested election.
Users of social media and messaging apps began reporting disruptions early on Tuesday on Twitter, WhatsApp, Instagram and Snapchat.
Twitter has responded by saying the shutdown violates basic human rights and the principles of open internet.
Meanwhile the US has condemned the government's decision to shutdown social media, while the UN chief Antonio Guterres has called for respect for human rights.
Mr Guterres "encourages all political actors and their supporters to publicly commit to conduct their political activities peacefully and refrain from incitement to violence or hate speech", his spokesman Stephane Dujarric said.
We are concerned by reports that the Government of Uganda has ordered Internet service providers to block social media platforms, messaging apps, and select content in the run up to general elections on Jan 14. Such restrictions undermine human rights and fundamental freedoms.— Tibor Nagy (@AsstSecStateAF) January 12, 2021
US diplomat for Africa Tibor Nagy tweeted: "Such restrictions undermine human rights and fundamental freedoms."