Tanzania's ruling party looked set to win presidential and parliamentary elections on Sunday despite a challenge to its five decades in power from former Prime Minister Edward Lowassa, who has voiced concerns the poll may not be free or fair.
Late on Sunday Chadema party, part of the opposition coalition led by Lowassa, said police raided its vote-tallying centre in Tanzania's commercial capital Dar es Salaam and arrested opposition officials.
Any dispute in the outcome of the election - billed as the tightest race in Tanzania's post-independence history - could raise tensions in a nation which has been relatively stable since British rule ended in 1961.
Some officials and analysts have voiced particular concern about rising tensions in the semi-autonomous archipelago of Zanzibar, where the opposition had accused the government of intimidation ahead of the polls.
But voting was broadly peaceful across the vast East African nation of 47 million people, with a high turnout in many urban areas leading to delays.
Opinion polls and analysts have forecast a presidential victory for John Magufuli, the ruling CCM party's candidate. But many expect CCM's parliamentary majority to dwindle after the opposition united behind a single candidate for the first time.
In power for more than half a century, CCM has faced growing pressure to speed up development of Tanzania's significant natural gas resources to spur economic growth and lower stubbornly high poverty rates.
"Life is too difficult," said 33-year-old Lowassa supporter Michael Mlay, soon after the polls opened at 7 a.m. (0400 GMT) in the commercial capital Dar es Salaam. "The CCM government has failed to deliver."
Voters had begun massing at some polling stations at 5 a.m., before dawn broke. High turnout was reported in several areas, and queues snaked around corners amid complaints of long delays.
"I have voted for Magufuli because I believe he will keep his promises. He is a man of integrity," said Francis Komba, a 43-year old taxi driver who waited four hours to vote.
Some 22.75 million people had registered to vote, with about 57 percent aged 35 or younger. Polls closed at 1300 GMT.
At most polling stations CCM and the opposition fielded their own observers with each sending results back to their own tallying centres to get an idea of voting patterns and to try to prevent electoral fraud.
Chadema's national chairman, Freeman Mbowe, said the police raided a tallying centre and showed the CCM government was "using dictatorial tactics to manipulate elections and intimidate our people".
Neither police nor government spokespeople could be reached for comment.
On the eve of the vote, Lowassa, who defected from CCM in July after the party spurned him as a possible leadership candidate, said he would only concede defeat if the vote was free and fair.
"If it's not, I won't concede," he said.
Outgoing President Jakaya Kikwete, who will step down after serving two terms, has appealed against any violence.
Results were expected to start trickling in on Monday, and the electoral commission has said it plans to announce the winner within three days of polls closing.
Both Magufuli and Lowassa have drawn tens of thousands of people to lively rallies, vowing to curb frequent power outages and ensure future economic growth reaches the poor.
They have also pledged to tackle rampant corruption, pave roads and improve a crumbling infrastructure that hinders businesses and weighs on everyday life.