Tanzanian President John Magufuli won a resounding election victory Friday with 84 percent of votes in a poll his main rival said was riddled with irregularities such as ballot box stuffing.
Magufuli's main challenger, the Chadema party candidate Tundu Lissu, 52, won only 13 percent of the vote, after denouncing widespread fraud, intimidation and oppression of the opposition.
"The commission declares John Magufuli of CCM (Chama Cha Mapinduzi) who garnered the majority of votes as the winner in the presidential seat..." said commission chairman Semistocles Kaijage.
Voter turnout was 50.7 percent from more than 29 million voters, with over 260,000 votes declared invalid.
No final results were given for the parliamentary results however Magufuli's ruling CCM had earlier won all but two seats, with around 200 of 264 parliamentary seats announced.
In 2015, Magufuli won with only 58 percent of the vote.
The resounding victory in Wednesday's vote will further cement the power of a party that has been in power since independence in 1961 but stands accused of a slide into autocracy under Magufuli.
Lissu, who returned to Tanzania in July after three years abroad recovering from 16 bullet wounds sustained in an assassination attempt, on Thursday declared that the results coming in were "illegitimate".
He urged his supporters to demonstrate peacefully, while asking the international community not to recognise the outcome.
"Whatever happened yesterday was not an election, and thus we do not recognise it. We do not accept the result," Lissu told reporters, saying opposition election monitors had been barred from entering polling stations and faced other interference.
"What is being presented to the world is a complete fraud. It is not an election."
The result of presidential elections cannot be contested in Tanzania, though the parliamentary outcome can be challenged.
Lissu's return breathed life into an opposition demoralised by years of attacks, arrests and a ban on political rallies.
However several opposition MPs lost seats in long-held bastions, such as Chadema chairman and lawmaker Freeman Mbowe of Hai in the Kilimanjaro region, and ACT-Wazalendo party leader Zitto Kabwe in Kigoma on the shores of Lake Tanganyika.
Halima Mdee, head of the Chadema woman's wing, who was briefly arrested on election day after protesting the discovery of ballot boxes stuffed with "pre-marked votes", lost her seat in Kawe in Dar es Salaam.
"We are concerned by credible reports of election irregularities and the use of force against unarmed civilians, and will hold responsible individuals accountable," said US state department spokeswoman Morgan Ortagus on Twitter.
"We urge Tanzanian authorities to take immediate steps to restore faith in the democratic process."
The election took place with little monitoring from foreign observers and most international media were unable to gain accreditation to cover voting on the mainland.
In semi-autonomous Zanzibar, which elects its own president and MPs, the streets were quiet and only a few pick-up trucks carrying police circulated after CCM candidate Hussein Ali Mwinyi was declared the local winner.
The Indian Ocean archipelago, which has a history of violent and contested polls, saw only four of 50 parliamentary seats go to the opposition ACT Wazalendo.
Opposition leader Seif Sharif Mohammed was arrested the day before the vote, as well as the day following the vote, and decried the election as a "military exercise" overshadowed by violence and cheating.
His party said he was released after the election results were announced, while party spokesman Ismail Jussa was badly beaten, sustaining a broken leg and shoulder fracture during their arrest.
Hamad has accused the ruling party of trying to steal every vote since multi-party democracy was introduced in 1995, and foreign observers have often agreed.
The islands swarmed with police, soldiers -- some on armoured personnel carriers -- and the feared "zombie" private militia of the ruling party in recent days.
The opposition said 10 people were killed on Monday and Tuesday.