Mr Museveni won almost 59% of the vote, with Bobi Wine trailing with about 35%, the Electoral Commission said.
Bobi Wine, a former pop star, earlier vowed to provide evidence of fraud. The Electoral Commission denies there was vote-rigging in Thursday’s poll.
Poll monitors have criticised the government closure of internet access.
The say this undermined confidence. Bobi Wine said he would provide evidence of fraud once the internet was restored.
Dozens of people were killed during violence in the run-up to the election. Opposition politicians have also accused the government of harassment.
The result gives President Museveni a sixth term in office.
The 76 year old, in power since 1986, says he represents stability in the country.
Meanwhile, Bobi Wine – the stage name for 38-year-old Robert Kyagulanyi – says he has the backing of the youth in one of the world’s youngest nations, where the median age is 16.
On Friday, as the results came in, Bobi Wine said that Ugandan soldiers had surrounded and breached his home.
But a government spokesman accused him of “dramatising” the incident “to seek sympathy”.