JOHANNESBURG (AP) — South Africa’s president on Sunday vowed to purge his party of “bad and deviant tendencies” as he prepares to appoint a new Cabinet following a victory in national elections.

The 57% share of the vote was the worst-ever election showing for the African National Congress, which has ruled since the harsh apartheid system of racial discrimination ended 25 years ago. The party won 62% of the vote in 2014.

Low voter turnout of 65% in the May 8 election also reflected the frustration of many South Africans after corruption scandals around the ANC that led former president Jacob Zuma to resign last year under party pressure. Turnout was 74% in 2014.

Current President Cyril Ramaphosa in his first speech to supporters since the election win said he will not appoint leaders who work “to fill their own pockets.”

He told thousands of supporters in downtown Johannesburg that “we are going to end corruption whether they like it or not.” The revelations by a government commission investigating graft, often aired live on television for fascinated South Africans, “must be things of the past,” the president said.

Ramaphosa, however, is believed to be facing a revolt within the party by Zuma allies, one that could surface in the coming weeks as he decides on the makeup of his new government.

Observers have said South Africa’s economy, the most developed in sub-Saharan Africa, would be further weakened if Ramaphosa is removed by his own party. He narrowly won the party leadership in late 2017, weeks before Zuma was pushed out.

Ramaphosa on Sunday urged ANC leaders to not hang the party’s “dirty linen in public” and said the party must be renewed “so that we cleanse it of all the bad and deviant tendencies.”

In South Africa, the president and parliament are not elected directly. The number of votes won by each party determines how many representatives are sent to the national 400-seat legislature. The president of the country is the leader of the party that gets the most votes.

The ANC slipped to holding 230 parliament seats, while the main opposition Democratic Alliance now holds 84 and the populist Economic Freedom Fighters have 44. The EFF gained ground in just its second presidential and parliamentary election, winning 10.7% of the vote, up from 6.3% five years ago.