Angola's ruling MPLA party has won the country's parliamentary elections, but lost ground to the opposition, the electoral commission said citing provisional results.

The MPLA took 61.1 percent of the votes counted compared with the opposition UNITA party's 26.7 percent, results showed on Friday.

Out of the nine million registered voters, about 23 percent did not go to the polls on Wednesday.

Joao Lourenco, the country's defence minister, will replace President Jose Eduardo dos Santos, who is stepping down after 38 years in power.

The 74-year-old dos Santos is expected to remain head of the ruling People's Movement for the Liberation of Angola (MPLA) party, which has ruled Angola since it gained independence from Portuguese rule in 1975.

The electoral commission said the MPLA had won 150 of 220 parliamentary seats in the National Assembly, giving them the two-thirds majority needed to pass any legislation without help from another party.

UNITA's share of seats rose from 32 to 51.

Opposition cries foul

With 98 percent of the vote counted, MPLA took an unassailable lead with the National Union for the Total Independence of Angola (UNITA) crying foul.

"The process violated the law and the principles of democracy," Claudio Silva, who sits on the electoral commission as a UNITA representative, told Reuters news agency.

Angolan rights activists have alleged that the MPLA unfairly used state machinery ahead of the election, noting that most media coverage focused on the ruling party's campaign.

Opposition parties said there were irregularities ahead of the voting, an allegation denied by the ruling party.

READ MORE: Angola News - the latest from Al Jazeera

The opposition, UNITA and CASA-CE, made big inroads with a combined 50 percent majority in the populous Luanda province.

The MPLA and UNITA fought on opposing sides in a 27-year civil war that ended in 2002, but Angola has been mostly peaceful since.

Heavily reliant on oil, Angola's economy has weakened because of the global fall in commodity prices.

Lourenco has vowed to revive the economy and has not ruled out deals with the World Bank and IMF to help restructure an economy that is overly dependent on oil.

Angola imports at huge costs everything from washing powder to long-life milk.