Cyril Ramaphosa was confirmed as the new President of South Africa on Thursday just hours after the scandal-plagued Jacob Zuma resigned from office.
Ramaphosa, the leader of the ruling African National Congress party since December, was the only candidate nominated.
The announcement was met with singing and dancing by some members of the National Assembly in Cape Town, though members of the opposition Economic Freedom Fighters party walked out of the chamber in protest during the debate.
Parliament had been due to hold a no-confidence vote on Thursday to remove Zuma from office.
In a nationally televised address on Wednesday night, Zuma announced his resignation, saying he had been disturbed about the "instances of violence" outside the party's headquarters.
"No life should be lost in my name and also the ANC should never be divided in my name. I have therefore come to the decision to resign as President of the Republic with immediate effect," Zuma said.
"Even though I disagree with the decision of the Leadership of my organization, I have always been a disciplined member of the ANC," he added.
Ramaphosa's elevation to president caps a dramatic week that saw Zuma, dogged by corruption allegations for years, effectively pushed out of office by his own party. Zuma denies all of the corruption allegations against him.
Second chance at the presidency
The 65-year-old Ramaphosa -- who, as deputy president, became interim president immediately after Zuma's resignation on Wednesday -- made his name as a trade union leader during the apartheid era and as the chief negotiator for Nelson Mandela, helping to shepherd the country out of white minority rule in the 1990s.
When Mandela's presidency came to a close, he made it clear that he wanted Ramaphosa to succeed him. But Ramaphosa lost the race to lead the ANC -- and therefore the country -- to Thabo Mbeki, another anti-apartheid leader who returned to South Africa after living in exile.
Ramaphosa left government afterward and made his fortune in the business world.
However, since returning to public life he has spoken out against corruption in the country and has found significant support in urban areas, in the business community and among ANC stalwarts.
Ramaphosa was elected to head the ANC in December with a pledge to tackle corruption and the myriad of other problems facing the country.
"We want to clean up South Africa so that we can begin to make it more attractive to investors but at the same time to deal with the issues that are impeding growth," Ramaphosa told CNN's Christiane Amanpour in an interview last month.
Ramaphosa said he believed his anti-corruption campaign would reinvigorate supporters of the ANC who were previously disillusioned with the party.
"This is not a flash in the pan," Ramaphosa said. "We are going to make sure that we do not disappoint our people."