Jakaya Kikwete appears to have won Tanzania's presidential election after gaining 80.2% of the vote.
Jakaya Kikwete's victory was never in doubt
His Chama Cha Mapinduzi (CCM) party also retained an outright majority in parliament.
However, Labour Party candidate Augustine Mrema has filed a law suit, asking the courts to stop the election commission from announcing a winner.
Mr Kikwete, 55, presently foreign minister, will take over from Benjamin Mkapa, who steps down after two terms.
Mr Mrema, who won less than 1% of the vote according to official figures, said the poll had been rigged.
"I am determined to prove that CCM has won these elections fraudulently. I do not care if people accuse me of being a bad loser because I know if I lost fairly I would have accepted the results," he told Reuters news agency.
Mr Kikwete's nearest rival, the opposition Civic United Front's (CUF) candidate Ibrahim Lipumba, took 11.6% of the vote.
Unless the courts step in, Mr Kikwete is expected to be confirmed as president-elect on Tuesday.
Turnout was 72% of the registered voters with 11.3 million votes cast.
The CCM won 206 parliamentary seats compared to 19 for the CUF, five for Democracy and Development and one each for the Labour Party and the United Democratic Party.
Despite violence on Zanzibar, a CUF stronghold, African Union observers say the poll was mostly peaceful and should be respected.
Mr Kikwete collapsed on the final day of campaigning last Tuesday, with his party saying he had succumbed to exhaustion.
Opposition parties complained of an uneven playing field, accusing the ruling party of using state resources during the campaign.
The head of the African Union observer mission, Baleta Mrete, has urged the opposition parties and all peace-loving Tanzanians to accept and respect the results of the elections.
The exception to the rule was the semi-autonomous islands of Zanzibar, where opposition protesters were hurt in clashes with police.