President Samia Suluhu Hassan has been declared the winner of Tanzania's presidential election, securing another term in office amid days of unrest across the country.

According to the electoral commission, Samia won 98% of the votes, nearly sweeping the 32 million ballots cast in Wednesday's election.

International observers have expressed concern over the lack of transparency and widespread turmoil that has reportedly left hundreds people dead and hundreds injured.

The nationwide internet shutdown is making it difficult to verify the death toll. The government has sought to play down the scale of the violence - and authorities have extended a curfew in a bid to quell the unrest.

I hereby announce Samia Suluhu Hassan as the winner of the presidential election under the Chama Cha Mapinduzi (CCM) party, Jacobs Mwambegele, the electoral chief, said while announcing the results on Saturday morning.

In Tanzania's semi-autonomous archipelago of Zanzibar - which elects its own government and leader - CCM's Hussein Mwinyi, who is the incumbent president, won with nearly 80% of the vote.

The opposition in Zanzibar said there had been massive fraud, the AP news agency reported.

Protests continued on Friday, as demonstrators in the port city of Dar es Salaam and other cities took to the streets, tearing down Samia's posters and attacking police and polling stations despite warnings from the army chief to end the unrest.

The demonstrations are mostly led by young protesters, who have denounced the election as unfair.

A spokesperson from the opposition Chadema party reported that around 700 people had been killed in clashes with security forces, while a diplomatic source claimed credible evidence of at least 500 fatalities.

Foreign Minister Mahmoud Kombo Thabit described the violence as a few isolated pockets of incidents here and there and emphasized that security forces acted promptly to address the situation.

Two main opposition contenders were excluded from the election; Tundu Lissu is in jail facing treason charges, and Luhaga Mpina was disqualified on legal grounds.

Rights groups condemned the government for repression leading up to the elections, highlighting incidents of enforced disappearances and torture of opposition figures, which the government has denied.

Samia entered office in 2021 as Tanzania's first female president after the death of President John Magufuli.