Uganda blocked social media sites including Twitter, Facebook and Whatsapp before the swearing-in ceremony on Thursday of President Yoweri Museveni, whose re-election sparked protests and a crackdown on dissent.
Museveni, 71, officially won 60 percent of the vote in February, allowing him to take on another term and extend his rule to 35 years. The opposition cried foul and protests broke out, leading to some clashes with police and dozens of arrests.
On Wednesday, police arrested opposition leader Kizza Besigye after a street protest. Besigye, who heads the Forum for Democratic Change party, won 35 percent of the vote in February. He has been under house arrest on and off since.
Godfrey Mutabazi, executive director of the telecommunications regulator, said security agencies had requested the move as "a measure to limit the possibility of terrorists taking advantage" of visits by dignitaries.
Uganda is hosting several heads of state for the ceremony.
In the preceding days, the authorities have placed more security patrols on the streets of Kampala and residents said there was a strong presence of military and police personnel on Thursday.
The authorities blocked social media during voting and shortly afterwards, a move criticised at the time by the United States and rights groups, who said it undermined the integrity of the process.
EU monitors said the election was held in an intimidating atmosphere and the electoral body lacked independence and transparency. Ugandan officials said it was free and fair, and dismiss accusations that they have clamped down on free speech.
The government had also banned any live television or radio coverage of protests.
Opposition to Museveni is strongest among youths in urban areas, where frustration has been fuelled by unemployment, corruption and crumbling public services.
Museveni has been credited with restoring order after years of chaotic rule since coming to power in 1986. The economy has been growing, but experts say it has failed to keep pace with the rising population.
Critics also complain about Museveni's failure to stem corruption and a clampdown on opposition voices.