"I duly declare John Pombe Magufuli to have been duly elected President of the United Republic of Tanzania," NEC chief Damian Lubuva announced.
The win by Magufuli cements the long-running Chama Cha Mapinduzi (CCM) party's firm grip on power, after ruling Tanzania since 1977 when two independence-era parties merged.
Magufuli won 58.46 per cent of votes, a total of 8,882,935, compared to his closest rival Edward Lowassa, a former prime minister, who won 39.97 per cent of the total, or 6,072,848 votes, according to the NEC.
But Lowassa, a former CCM stalwart turned opposition chief, rejected the official results and accused the election body of falsifying tallies.
Also Read
"We refuse to accept this attempt to rob the citizens of Tanzania of their democratic rights, which is being done by the National Electoral Commission by announcing results which are not the actual results," Lowassa told reporters.
"We are requesting that the National Electoral Commission announces that Edward Lowassa is the winner of the presidency."
The elections, held on Sunday, were the hardest fought electoral race in the east African nation's history, with the opposition providing the first credible challenge to the CCM since the introduction of multi-party democracy in 1995.
The results included votes from the semi-autonomous Zanzibar archipelago, despite the electoral commission on the islands having annulled polls over irregularities.
African and other international observers in Tanzania said they were deeply concerned at Zanzibar's annulment, urging leaders to "cast aside their differences" to ensure peace.