Cyril Ramaphosa has been elected president of South Africa in the National Assembly in Cape Town.
Mr Ramaphosa, a confidante of the late Nelson Mandela and a wealthy businessman, was deputy under President Jacob Zuma.
He automatically became acting president when the embattled leader stood down on Wednesday, but was only declared president of the republic on Thursday afternoon.
Singing and clapping broke out in the assembly after it was announced that Mr Ramaphosa was the only nominee for the role.
Chief justice Mogoeng Mogoeng, who was chairing the session, was greeted with laughter when he said: “I’m trying to adapt to the environment, I’m not used to it. In a court of law, no singing is allowed.”
In his first speech as president, Mr Ramaphosa said he was “truly humbled” to have been given the “great privilege” of serving the South African people.
As president, he said his role was to be a “servant of the people of South Africa”, and he would serve with “humility, faithfulness and with dignity as well”.
He addressed the issue of corruption in the country, saying “South Africa must come first in everything that we do”.
His predecessor Mr Zuma’s two terms as president had been dogged by corruption allegations, relating specifically to a 1999 arms deal, a rape accusation, and his relationship with the powerful Gupta family.
He came under intense pressure from his ruling African National Congress (ANC) Party to resign, and finally did so having become a symbol of corruption.
A cheer went up in the National Assembly when speaker Baleka Mbete announced Mr Zuma’s resignation.
Residual supporters of Mr Zuma remain within the ANC, and one of Mr Ramaphosa’s first tasks as president will be to unite the party.
Prime Minister Theresa May offered her “warm congratulations” to the new South African president.
Ms May said: “The United Kingdom greatly values its dynamic and forward-looking partnership with South Africa, underpinned by the strong people-to-people and business ties between our countries.
“I look forward to working closely with President Ramaphosa to help build a healthier, more secure and prosperous future for both our countries.
“I very much hope to see the President at the Commonwealth Heads of Government Meeting in London in April.”
Join our new commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies