Votes are being counted in South Africa’s general election, with President Cyril Ramaphosa hoping to prevent a slide in support for the governing African National Congress.

With results declared in some 23% of districts, the ANC has won about 55% of the ballot, well ahead of the opposition Democratic Alliance on 26%.

However, the ruling party took 62% at the last election in 2014.

Anger over the economy and corruption may have eroded its appeal.

Almost two-thirds of the electorate voted in the twin parliamentary and provincial elections, and full results are due on Saturday.

Casting his vote in the country’s sixth democratic national election since apartheid ended 25 years ago, President Ramaphosa acknowledged the “rampant corruption” of recent years.

“We have made mistakes but we have been sorry about those mistakes and we are saying our people should reinvest their confidence in us,” he said.

“Corruption got into the way, patronage got into the way and not focusing on the needs of our people got in the way.”

The ANC, which led the fight against apartheid, has governed the country since 1994.

Challenging the party are the centrist Democratic Alliance (DA) and the Economic Freedom Fighters (EFF), which has won 8%, based on the official early results.