Jakaya Kikwete of Tanzania's governing party has a huge lead in the race to be the country's next president, the electoral panel said on Saturday.
Jakaya Kikwete looks on course to be next president
It also said his Chama Cha Mapinduzi party (CCM) was well on course to extend its 44-year grip on parliament.
With nearly 6.7 million votes counted, Mr Kikwete had more than 78%, official figures revealed.
Despite violence on Zanzibar, Africa Union observers say the poll was mostly peaceful and should be respected.
Mr Kikwete, 55, presently Tanzania's foreign minister, looks set to take over from President Benjamin Mkapa, who is stepping down after two terms, as stipulated in the constitution.
Mr Kikwete collapsed during campaigning on Tuesday, with his party saying he had succumbed to exhaustion.
The CCM had taken 92 parliamentary seats, against 13 for the opposition CUF party and four for Chadema, with more than half the results still to come in, electoral officials said on Saturday afternoon.
Correspondents said the 17 poorly-funded opposition parties had struggled to compete with the well-financed campaign run by the CCM.
Chadema presidential candidate Freeman Mbowe, in third place so far, said the initial results were "surprising and disappointing".
"And it's definitely not good for the whole democratic process of the country," he told the BBC's Focus on Africa programme.
The BBC's Vicky Ntetema in Dar-es-Salaam says opposition leaders and supporters have already started accusing the ruling party of fraud.
However preliminary reports from local and international observers indicate that although there were some logistic irregularities, the elections were free and fair and that they were conducted in a peaceful manner free from intimidation, she says.
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.
Zanzibar is a stronghold of the opposition, and most of the declared seats have gone to the CUF, our correspondent says.