President Cyril Ramaphosa saved the African National Congress (ANC) from a crushing defeat in this week’s general election, senior officials in South Africa’s ruling party have said.

With 80% of the ballots cast counted by noon local time (1100 GMT) on Friday, the ANC was on course to retain its majority with a 57% share of the vote.

Though the result will be the first time the party’s share has fallen below 60% in national elections since South Africa’s first free vote in 1994, some analysts described it as a “decent performance” that could help Ramaphosa push through changes.

The 66-year-old former labour activist and tycoon, who took power last year, had called on voters to back his efforts to root out graft and incompetence within the ruling party, and push through measures to boost South Africa’s flagging economy.

Many South Africans have been angered by collapsing public services, soaring unemployment, power cuts and high levels of violent crime. There is also rising anger at the ANC’s failure to hold its officials to account after graft investigations.

The party’s head of elections, Fikile Mbalula, told reporters on Thursday night that if Ramaphosa had not ousted his predecessor, Jacob Zuma, as leader of both the party and the nation during a fierce three-month struggle for power in late 2017 and early 2018, the ANC might have polled as low as 40%.

Zuma’s nine-year rule was marked by sharp economic decline and a series of corruption scandals.

The ANC won 62% of the vote in 2014’s parliamentary election, down from 2009 and far short of its best result, 69% in 2004 under Thabo Mbeki. The party lost further ground in municipal elections in 2016, ceding control of key cities to the Democratic Alliance (DA).

Richard Calland, an expert in South African politics at the University of Cape Town, said Ramaphosa had successfully arrested the decline of the ANC.

“A lot is to do with Cyril. He is the most trusted of the political leaders available to the electorate and more trusted … than his own party,” said Calland.

Others analyst said Ramaphosa, though certain to get a five-year mandate as president, had not achieved the resounding success needed to defeat resistance to his reformist agenda from within the ANC and a hardline faction of the party that still hopes to oust him.

Mbalula said the president was safe from any internal challenge. “The president’s position is not under threat in any way. One hundred per cent ANC members are behind the president, but I cannot account for dark forces who will make an attempt on Ramaphosa for one reason or another … The ANC is determined to consolidate its unity,” he said.

President Cyril Ramaphosa greets supporters after casting his vote in Soweto, Johannesburg. Photograph: Ben Curtis/AP

Polls predicted the ANC would win between 55% and 62% of the vote in this election. The centre-right DA looks likely to secure 22%, according to current results, broadly in line with its internal estimates. However, it has not increased its share since 2014.

“I am proud of what the DA has done. We stuck the course … Even though we lost some votes, we will go back as a party and regain those votes. We have shown that where we govern life changes for the better,” Mmusi Maimane, the party’s leader, said on Friday.

The far-left Economic Freedom Fighters party (EFF) seems to have significantly underperformed, with about 10% of the vote.

Control of nine provinces was also contested in the polls. Latest results show the DA retained power in Western Cape. The crucial province of Gauteng, South Africa’s wealthiest, is closely contested but the ANC looks likely to win elsewhere.

The ruling party still benefits from the legacy of Nelson Mandela, and its central role in the struggle against apartheid, as well as deep support in rural areas.

“I voted for the ANC because I have done this all my life, and because they have done good things where I am from,” said Johnson Dlamini, a 35-year-old mechanic in Johannesburg.

But the achievements of the 1980s and 1990s resonate less with younger voters, and internal factional fighting has alienated many.

Ramaphosa will face pressure for more radical measures to redistribute wealth within South Africa, one of the world’s most unequal countries.

A big issue has been the implementation of a 2017 ANC pledge to redistribute prime agricultural land, currently disproportionately owned by white people, who make up fewer than 10% of the population. Ramaphosa has vowed to accelerate the redistribution of land to the black majority, endorsing an opposition bill to amend the constitution to make expropriation without compensation easier.

At a campaign event last week in Johannesburg, the president said there would be a step change in the pace of reform and the economy was ready for liftoff.

But the ANC’s list of parliamentary candidates contains many hardliners who are opposed to Ramaphosa’s reformist agenda and could frustrate his initiatives in parliament.