Internet was partially restored in Uganda on Monday almost five days after a near-total blackout was imposed across the East African country ahead of elections the opposition says were rigged.

The gradual easing of internet curbs came as police announced dozens of arrests for alleged election-related violence, and surrounded the headquarters of the main opposition party whose leader is effectively under house arrest.

President Yoweri Museveni extended his 35 years in power in January 14's election, securing a sixth term with 58.6 percent of the vote.

His main rival, musician-turned-lawmaker Bobi Wine, came a distant second with 34.8 percent. Wine has rejected the results, and decried the election as a sham.

Museveni supporters in Kampala celebrated after his victory was announced on Saturday
Museveni supporters in Kampala celebrated after his victory was announced on Saturday AFP / Yasuyoshi CHIBA

A government spokesman said an unprecedented internet shutdown imposed on January 13 for alleged national security reasons had been lifted.

"The internet has been restored. Other platforms are still under review," spokesman Ofwono Opondo told AFP.

"We shall go full throttle depending on what happens in the initial phase of opening connectivity... We advise internet users, especially those from the opposition, not to use it to promote hate messages, threats" and intimidation.

Uganda presidential candidate Bobi Wine shows how security forces jumped his fence after Thursday's election
Uganda presidential candidate Bobi Wine shows how security forces jumped his fence after Thursday's election AFP / Yasuyoshi CHIBA

Social media access remained patchy in the capital Kampala, where millions of internet users have been unable to send emails, search the web, or use Facebook, WhatsApp and other communication platforms for the better part of a week.

NetBlocks, a non-governmental organisation that tracks internet shutdowns, said network data showed a rise in connectivity in Uganda to 37 percent after all but core infrastructure, regulatory and government networks were switched off.

"This suggests that Uganda's election shutdown, or at least the procedure under which it was implemented, was planned some time in advance. This has been one of the more orderly nation-scale network blackouts we've tracked," NetBlocks told AFP.

The headquarters of Wine's National Unity Platform (NUP) in Kampala was under police guard Monday in what the opposition leader called a "raid" by security forces.

Uganda AFP / STF

"Museveni, after committing the most vile election fraud in history, has resorted to the most despicable forms of intimidation," Wine tweeted.

His lawyer, Benjamin Katana, said he tried to visit his client on Monday but was denied permission. Wine last left his home to vote on Thursday, and his residence is surrounded by police and soldiers.

Uganda police spokesman Fred Enanga said Monday that 55 people had been arrested over the election period for "violent acts" including blocking highways and damaging property.

"Though the polls were peaceful and a success, there were criminal elements that wanted to cause violence," he said, adding the accused would face court.

The latest official figures Monday show NUP, which was formed less than a year ago, has won 61 parliamentary seats.

The result is unprecedented for an opposition party in Uganda, and cements its place as the lead rival to Museveni's National Resistance Movement, which has taken 361 seats so far.

Meanwhile the Daily Monitor newspaper reported Monday that thousands of votes at more than 1,200 polling booths were not included in the final presidential election result.

The Electoral Commission said in response that because Museveni received more than 50 percent in the first round it concluded the outcome "would not be overturned by votes" from those outstanding polling stations.

The run-up to the vote was marred by the worst pre-election bloodshed in years, and a sustained crackdown on government critics and Museveni's rivals.

After Wine was arrested in November at least 54 people were shot dead during two days of street protests. The opposition leader was repeatedly detained and his rallies broken up with tear gas and live rounds.

The United States said it was "deeply troubled" by reports of violence and irregularities in Thursday's poll, though Museveni declared it the cleanest in Uganda's post-independence history.