Angola's ruling party has a solid majority after nearly all votes were counted in a national election, the electoral commission said on Thursday, but the main opposition party has cast doubt on the results of the divisive poll.

The MPLA's likely win would give President Joao Lourenco a second five-year term in the oil-producing southern African nation, and extend his party's continuous rule of nearly five decades since independence from Portugal in 1975.

But if the ratios of votes remain as they are, it would also mean an unprecedented loss of the MPLA's two-thirds majority in parliament, forcing it to cooperate with opposition lawmakers for the first time.

The election commission said that with over 97% of the votes counted, the formerly Marxist MPLA (People's Movement for the Liberation of Angola) was ahead with a 51.7% majority, while its main opposition rival the National Union for the Total Independence of Angola (UNITA) had 44.5%.

Election commission spokesman Lucas Quilondo said these were effectively the final results. "It does not seem to us that there will be substantial changes," he told a news briefing on Thursday evening.

However, Mihaela Webba, vice-president of the parliamentary group for UNITA - led by presidential hopeful Adalberto Costa Junior - had previously said on Thursday that the party believed it was likely the true victor.

"We probably won," she said before near-final results were announced. "We were dismayed ... The (election commission), without legal basis, is announcing the provisional results. Election results being announced might not be real ones."

UNITA had not yet commented on the most recent results issued by the electoral commission.

According to UNITA's count of nearly 40% of results, it had 46.89% of the vote and the MPLA has 47.99%.

The election commission (CNE) has repeatedly said the election was fair and transparent.

Asked about UNITA allegations of irregularities, MPLA spokesman Rui Falcao said "we have nothing do with it.

"Anyone who makes a complaint has to present evidence and has to deal with whoever has the competence to do so. The MPLA is a player. It is not the referee. The CNE is the referee, and the CNE is responsible for deciding."

The results were published with remarkable speed just one day after the vote. At the last elections in 2017, it took two weeks for the counting to be completed.

The dispute over the latest counting process has fuelled fears of post-election violence, and some 80,000 police officers were deployed across Angola to prevent possible unrest.

The streets have been mostly calm, however, aside from small gatherings in the capital Luanda, which police dispersed with tear gas and beatings.

'SIGNIFICANT DEFEAT'

Even if UNITA lost, this was the MPLA's worst result yet. The ruling party overwhelmingly lost in Luanda, which Falcao described as a "significant defeat" in an interview in Portugal's Publico newspaper.

"The 500,000 jobs we were promised is a lie... We have nothing," shouted unemployed Luanda resident Paulo Tomas, 30, shortly after the results were announced.

UNITA and the MPLA have been rivals since before Angola gained independence from Portugal. The two sides fought a civil war intermittently for over 25 years, in which hundreds of thousands of people were killed.

The last, decade-long bout of fighting was triggered in 1992 when UNITA contested election results that gave the MPLA a clear majority, reigniting conflict which lasted until government troops killed UNITA rebel leader Jonas Savimbi in 2002.

Lourenco had promised change and broad-based prosperity when he won elections in 2017, but despite a crackdown on corruption he has largely not delivered on a pledge to reduce poverty that remains widespread despite Angola's oil wealth.

Investors meanwhile viewed the result positively, with Angola's sovereign dollar bonds gaining on Thursday after initial election results were announced.

Recent elections, including the last one in 2017, did not spur widespread violence as MPLA's lead remained solid, but a report by the Institute for Security Studies said that if an MPLA win were perceived as fraudulent, unrest could follow.

Angolan political analyst Claudio Silva told Reuters that photos of results sheets taken by voters contradicted the provisional count of the election commission.

Several videos showed angry voters at polling stations complaining that the result sheet was not shared with the public for consultation, a requirement under Angolan law.

Reuters could not independently verify the footage.