The parties have come to an agreement and Cyril Ramaphosa remains as president of South Africa.
An overwhelming majority in the country's parliament voted for the ANC leader late on Friday.
The vote became a formality after the largest opposition party, the Democratic Alliance (DA), had previously announced that it had reached an agreement to form a coalition government with, among others, the ANC.
From today, the DA will co-govern South Africa in a spirit of unity and cooperation, said the DA leader John Steenhuisen, according to the BBC.
He added that the government has tough challenges ahead of it – not least regarding the battered economy and the country's high levels of crime.
The parliamentary vote ended with 283 of the cast votes going to Ramaphosa. The only challenger, Julius Malema from the radical Economic Freedom Fighters, received 44 votes.
When the result was announced, the ANC's elected officials began to sing, reports the media company News24.
Now, the 71-year-old Ramaphosa is responsible for forming South Africa's first coalition government since the fall of apartheid and the first democratic election in 1994.
The ANC and DA are expected to govern the country together with the zulu nationalist Inkatha Freedom Party (IFP) and several smaller parties. In this way, more extreme parties are excluded from power – including the scandal-ridden former president Jacob Zuma's new party, MK.
On Thursday evening, the radical left-wing party Economic Freedom Fighters announced during a press conference that the party refuses to enter into a coalition with the DA.
On Wednesday, 29 May, elections were held in South Africa's nine provinces. It was the seventh democratic election held since the fall of the apartheid system.
Voters voted for parties to a proportional number of seats in parliament, which has 400 seats. These will now elect a president.
The Father of the Nation Nelson Mandela's African National Congress (ANC) suffered a catastrophic defeat and received around 40 per cent of the votes. Thus, the party lost its 30-year parliamentary majority.
The largest opposition party, the Democratic Alliance (DA), received 22 per cent and former President Jacob Zuma's party MK came third with 14.6 per cent.
Before this year's election, the ANC had won with between 60 and 70 per cent in all elections since 1994.
The voter turnout, around 59 per cent, is reported to be the lowest in South Africa's history.