Zanzibar's opposition leader said Tuesday that 10 people were killed as tension erupted on the islands ahead of Tanzania's elections, marked by concerns for a free and fair ballot.

Tanzanian President John Magufuli called for a peaceful vote as he and his main rival on the mainland, Tundu Lissu, wrapped up their campaigns on the eve of Wednesday's vote.

In semi-autonomous Zanzibar, which votes for Tanzania's president as well as its own leader and lawmakers, security forces fired teargas and live rounds and assaulted civilians, AFP reporters saw.

The Indian Ocean islands -- famed as a paradise holiday destination with white, palm-fringed beaches -- have a history of violence-plagued polls.

Opposition leader Seif Sharif Hamad, who is taking his sixth shot at the top office, said nine people had been killed on the second island of Pemba on Monday night, and one on the main island Unguja on Tuesday morning, with 50 injured.

Tanzanian Security Forces arrest two people in Stone Town, Zanzibar
Tanzanian Security Forces arrest two people in Stone Town, Zanzibar AFP / Patrick Meinhardt

"We are all aware that police have been firing teargas but also they have been firing live ammunition to shoot people," Hamad said at a press conference.

Detained for hours on Tuesday for attempting to vote on a special voting day set aside for security forces, he lashed the elections as a "farce."

Tanzanian police chief Simon Sirro told journalists in Dar es Salaam that 42 people had been arrested in Pemba, but denied there had been any deaths.

Map of Tanzania
Map of Tanzania AFP / Alain BOMMENEL

A relative of a woman who was shot dead -- and whose name figured on an opposition list of those killed -- told AFP "armed men carrying guns" had opened fire on him and others.

"It was around 9pm at night, we were seated outside a shop. But armed men carrying guns... just aimed and fired. I escaped safely but later found that three," including his relative, had been shot dead.

The opposition believes the special day of early voting for security forces -- which is not happening on the mainland -- is a ploy to steal the election, and had urged supporters to go out and vote on the same day. Hamad said all opposition party agents had been kicked out of polling stations.

Hamad said voting had already begun in some places on Monday night, which led to supporters in Pemba trying to block the distribution of ballots which they believe were pre-marked.

"How can you have an election were you have teargas everywhere and live ammunition? It is in no case a fair election, it is just a farce," said Hamad, of the ACT-Wazalendo (Alliance for Change and Transparency) party.

A Tanzanian security officer waits to cast her ballot in early voting
A Tanzanian security officer waits to cast her ballot in early voting AFP / Patrick Meinhardt

He said the islands' president, Ali Mohamed Shein, who is stepping down after serving two terms, has "blood on his hands", as did ruling Chama Cha Mapinduzi (CCM) candidate Hussein Ali Hassan Mwinyi.

Hamad, whose party seeks full independence, believes every vote has been stolen from him since the introduction of multiparty democracy in 1995, and foreign observers have often agreed.

Shortly before Hamad's arrest on the main island, police fired teargas and live rounds, while a group of about six brutally beat a young man around the Mtupepo primary school where the polling station is located in an opposition stronghold, an AFP reporter saw.

Journalists were chased away from the scene.

The area was later completely sealed off by security forces, along with other roads around Zanzibar, where the occasional pop of teargas being fired could be heard.

Trucks loaded with soldiers, police and a militia linked to the ruling party known as "zombies" -- clad in black with their faces covered by bandanas -- whizzed throughout the city.

AFP reporters witnessed the security forces beating several other civilians in different parts of town before loading them into their trucks.

The violence in Zanzibar comes amid rising fears over Tanzania's election after five years of crackdown on the opposition and free speech under Magufuli, who is running for a second term.

"I'm alarmed by reports from Zanzibar and elsewhere of violence, deaths, and detentions," United States ambassador Donald Wright wrote on Twitter.

On the last official day of campaigning, Magufuli urged citizens to "vote and go home. Let the electoral body do its work. Peace is very important and I pray it dominates the polls."

Lissu, who has invigorated the opposition after returning from three years abroad recovering from an attack in which he was shot 16 times, hailed a successful campaign in which he saw massive crowds at his rallies.

"I have witnessed through the campaign that Tanzanians are ready for changes and I believe they will turn out to vote tomorrow," he said.