South Africa will “never again” go through the levels of corruption and malfeasance it experienced over the past decade, president Cyril Ramaphosa promised after voting in the country’s sixth post-apartheid general election.

Speaking to media after casting his ballot at the Hitekani Primary School in Soweto, Gauteng province, on Wednesday, the leader of the African National Congress (ANC) urged voters to return the former liberation movement to power, saying it had learned from its mistakes.

“What we are saying is never, never, never again must South Africa go through what we have went through: Where there is sleaze, where there is malfeasance, where there is rampant corruption . . . We have learned our lesson,” he said.

The ANC president also acknowledged his party had deviated from the task of developing South Africa because it was undermined by corruption and patronage during the tenure of his predecessor, the scandal-prone Jacob Zuma.

Confidence

But he urged voters to reinvest their confidence in the movement that has governed South Africa for the past 25 years, saying if the ANC was re-elected it would work much harder under his watch to meet people’s needs.

“Corruption and patronage got in the way” of delivering services for the people, Mr Ramaphosa said, adding: “We [the ANC] now know what our weaknesses are.”

Wednesday’s general election was expected to be the toughest poll the ANC has contested since white minority rule ended in 1994, due to the rampant corruption and graft that took root in the party and government under Mr Zuma.

Most polls suggested the ANC will struggle to match its performance in 2014, where it secured 62.15 per cent of the vote, and might even lose its majority in three provincial legislatures, including Gauteng province, South Africa’s economic heartland.

The ANC’s main rivals for power are the Democratic Alliance (DA), the main opposition party led by Mmusi Maimane; and Julius Malema’s Economic Freedom Fighters (EFF), a radical left-wing party that has resonated strongly with the poor black majority since it was formed in 2013.

Violence

Voting at the 22,924 polling stations located across South Africa’s nine province passed off smoothly in most areas. However, the Independent Electoral Commission (IEC) confirmed that violence connected to people who wanted Wednesday’s vote boycotted had been reported in three provinces.

People in KwaZulu-Natal were stopped from voting at dozens of polling stations by protests and trenches that had been dug across access roads, while demonstrations also erupted in the North West and Northern Cape.

In total 17 voting stations nationwide were unable to open and six protest-related arrests had been made by early afternoon. Polls were due to close at 9pm local time.

The results of the parliamentary and provincial polls will be released by Saturday at the latest, and the presidential candidate of the party that wins the former ballot will lead South Africa for the next five years.