President Cyril Ramaphosa dances to music on stage during a victory rally for his African National Congress (ANC) party in downtown Johannesburg, South Africa Sunday, May 12, 2019. The ANC on Saturday marked its weakest victory in national elections in a quarter-century, while President Cyril Ramaphosa declared that the vote had given him and others

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.

___

Follow Africa news at https://twitter.com/AP_Africa

A supporter of the African National Congress (ANC) party wears beads in the party colors, and another wears a t-shirt of President Cyril Ramaphosa, right, during a victory rally in downtown Johannesburg, South Africa Sunday, May 12, 2019. South Africa's president on Sunday vowed to purge his party of
An African National Congress party (ANC) supporter gestures at a gathering at the ANC's headquarters in Johannesburg , South Africa, Sunday May 12, 2019 to celebrate their party's victory in South Africa's general election. President Cyril Ramaphosa is expected to address the rally. (AP Photo/Jerome Delay)
Supporters of African National Congress (ANC), during their celebration for election victory in Johannesburg, South Africa, Sunday, May 12, 2019. South Africa's ruling African National Congress on Saturday marked its weakest victory in national elections in a quarter-century, while Ramaphosa declared that the vote had given him and others
African National Congress party (ANC) President Cyril Ramaphosa arrives to address a rally at the ANC's headquarters in Johannesburg , South Africa, Sunday May 12, 2019. The ANC won Wednesday's South Africa's general election. (AP Photo/Jerome Delay)
African National Congress (ANC), president Cyril Ramaphosa, addresses supporters during their celebration for election victory in Johannesburg, South Africa, Sunday, May 12, 2019. South Africa's ruling African National Congress on Saturday marked its weakest victory in national elections in a quarter-century, while Ramaphosa declared that the vote had given him and others
African National Congress party (ANC) supporters gather at the ANC's headquarters in Johannesburg , South Africa, Sunday May 12, 2019 to celebrate their party's victory in South Africa's general election and cheer President Cyril Ramaphosa during his speech. (AP Photo/Jerome Delay)
African National Congress party (ANC) supporters gather at the ANC's headquarters in Johannesburg, South Africa, Sunday May 12, 2019 to celebrate their party's victory in South Africa's general election and cheer President Cyril Ramaphosa during his speech. (AP Photo/Jerome Delay)
African National Congress party (ANC) supporters gather at the ANC's headquarters in Johannesburg , South Africa, Sunday May 12, 2019 to celebrate their party's victory in South Africa's general election and cheer President Cyril Ramaphosa during his speech. (AP Photo/Jerome Delay)
African National Congress party (ANC) President Cyril Ramaphosa addresses supporters at the ANC's headquarters in Johannesburg , South Africa, Sunday May 12, 2019. The ANC won Wednesday's South Africa's general election. (AP Photo/Jerome Delay)
African National Congress party (ANC) supporters gather at the ANC's headquarters in Johannesburg , South Africa, Sunday May 12, 2019 to celebrate their party's victory in South Africa's general election and cheer President Cyril Ramaphosa during his speech. (AP Photo/Jerome Delay)
African National Congress party (ANC) President Cyril Ramaphosa addresses supporters at the ANC's headquarters in Johannesburg , South Africa, Sunday May 12, 2019. The ANC won Wednesday's South Africa's general election. (AP Photo/Jerome Delay)
A supporter of the African National Congress (ANC) party dances to techno music during a victory rally in downtown Johannesburg, South Africa Sunday, May 12, 2019. The ANC on Saturday marked its weakest victory in national elections in a quarter-century, while President Cyril Ramaphosa declared that the vote had given him and others
President Cyril Ramaphosa dances to music on stage during a victory rally for his African National Congress (ANC) party in downtown Johannesburg, South Africa Sunday, May 12, 2019. The ANC on Saturday marked its weakest victory in national elections in a quarter-century, while President Cyril Ramaphosa declared that the vote had given him and others
Supporters of the African National Congress (ANC) party, seen on a video screen, cheer as President Cyril Ramaphosa speaks, left, during a victory rally in downtown Johannesburg, South Africa Sunday, May 12, 2019. South Africa's president on Sunday vowed to purge his party of
A supporter of the African National Congress (ANC) party wears a t-shirt of President Cyril Ramaphosa and beads in the party colors, during a victory rally in downtown Johannesburg, South Africa Sunday, May 12, 2019. South Africa's president on Sunday vowed to purge his party of
Supporters of the African National Congress (ANC) party cheer during a victory rally in downtown Johannesburg, South Africa Sunday, May 12, 2019. South Africa's president on Sunday vowed to purge his party of
African National Congress party (ANC) supporters gather at the ANC's headquarters in Johannesburg , South Africa, Sunday May 12, 2019 to celebrate their party's victory in South Africa's general election. President Cyril Ramaphosa is expected to address the rally. (AP Photo/Jerome Delay)
Supporters of the African National Congress (ANC) party cheer as they arrive for a victory rally in downtown Johannesburg, South Africa Sunday, May 12, 2019. South Africa's president on Sunday vowed to purge his party of
Supporters of the African National Congress (ANC) party cheer during a victory rally in downtown Johannesburg, South Africa Sunday, May 12, 2019. South Africa's president on Sunday vowed to purge his party of
President Cyril Ramaphosa speaks at a victory rally for his African National Congress (ANC) party in downtown Johannesburg, South Africa Sunday, May 12, 2019. South Africa's president on Sunday vowed to purge his party of
A supporter of the African National Congress (ANC) party wears a t-shirt of President Cyril Ramaphosa during a victory rally in downtown Johannesburg, South Africa Sunday, May 12, 2019. South Africa's president on Sunday vowed to purge his party of
President Cyril Ramaphosa gestures to the crowd at a victory rally for his African National Congress (ANC) party in downtown Johannesburg, South Africa Sunday, May 12, 2019. South Africa's president on Sunday vowed to purge his party of
President Cyril Ramaphosa gestures to the crowd at a victory rally for his African National Congress (ANC) party in downtown Johannesburg, South Africa Sunday, May 12, 2019. South Africa's president on Sunday vowed to purge his party of
African National Congress party (ANC) supporters gather at the ANC's headquarters in Johannesburg , South Africa, Sunday May 12, 2019 to celebrate their party's victory in South Africa's general election. President Cyril Ramaphosa is expected to address the rally. (AP Photo/Jerome Delay)
African National Congress (ANC), president Cyril Ramaphosa, center, with his national executive greets supporters during their celebration for election victory in Johannesburg, South Africa, Sunday, May 12, 2019. South Africa's ruling African National Congress on Saturday marked its weakest victory in national elections in a quarter-century, while Ramaphosa declared that the vote had given him and others
Supporters of African National Congress (ANC), during their celebration of the election victory in Johannesburg, South Africa, Sunday, May 12, 2019. South Africa's ruling African National Congress on Saturday marked its weakest victory in national elections in a quarter-century, while Ramaphosa declared that the vote had given him and others
African National Congress party (ANC) supporters gather at the ANC's headquarters in Johannesburg , South Africa, Sunday May 12, 2019 to celebrate their party's victory in South Africa's general election. President Cyril Ramaphosa is expected to address the rally. (AP Photo/Jerome Delay)
African National Congress (ANC) supporters gather outside the party's headquarters in downtown Johannesburg, Sunday, May 12, 2019 to celebrate the party's win in elections. South Africans voted Wednesday with results showing that the ruling ANC has won the national elections but has seen its share of the vote drop significantly. (AP Photo/Mujahid Safodien)
Supporters of African National Congress (ANC), during their celebration for election victory in Johannesburg, South Africa, Sunday, May 12, 2019. South Africa's ruling African National Congress on Saturday marked its weakest victory in national elections in a quarter-century, while Ramaphosa declared that the vote had given him and others
Supporters of African National Congress (ANC), during their celebration of the election victory in Johannesburg, South Africa, Sunday, May 12, 2019. South Africa's ruling African National Congress on Saturday marked its weakest victory in national elections in a quarter-century, while Ramaphosa declared that the vote had given him and others
African National Congress (ANC), president Cyril Ramaphosa, left, dances with party member during their celebration for election victory in Johannesburg, South Africa, Sunday, May 12, 2019. South Africa's ruling African National Congress on Saturday marked its weakest victory in national elections in a quarter-century, while Ramaphosa declared that the vote had given him and others
African National Congress (ANC) supporters gather outside the party's headquarters in downtown Johannesburg, Sunday, May 12, 2019 to celebrate the party's win in elections. South Africans voted Wednesday with results showing that the ruling ANC has won the national elections but has seen its share of the vote drop significantly. (AP Photo/Mujahid Safodien)
African National Congress (ANC), president Cyril Ramaphosa, addresses supporters during their celebration of the election victory in Johannesburg, South Africa, Sunday, May 12, 2019. South Africa's ruling African National Congress on Saturday marked its weakest victory in national elections in a quarter-century, while Ramaphosa declared that the vote had given him and others
African National Congress (ANC) supporters gather outside the party's headquarters in downtown Johannesburg, Sunday, May 12, 2019 to celebrate the party's win in elections. South Africans voted Wednesday with results showing that the ruling ANC has won the national elections but has seen its share of the vote drop significantly. (AP Photo/Mujahid Safodien)
African National Congress (ANC), president Cyril Ramaphosa, left, dances with secretary-general Ace Magashule during their celebration of the election victory in Johannesburg, South Africa, Sunday, May 12, 2019. South Africa's ruling African National Congress on Saturday marked its weakest victory in national elections in a quarter-century, while Ramaphosa declared that the vote had given him and others
Supporters of African National Congress (ANC) gather during their celebration after the election victory in Johannesburg, South Africa, Sunday, May 12, 2019. South Africa's ruling African National Congress on Saturday marked its weakest victory in national elections in a quarter-century, while Ramaphosa declared that the vote had given him and others