The African Union has selected South Africa's Nkosazana Dlamini-Zuma as its new leader.
Dlamini-Zuma is the South African home affairs minister, a trained doctor and an ex-wife of President Jacob Zuma.
Ping had been the AU head since 2008.
Reuters said Dlamini-Zuma won after three rounds of voting. With a final confidence vote of 37 in her favor during a weekend summit at AU headquarters in Addis Ababa, Ethiopia, she at last received the 60 percent majority required to be elected to a four-year term.
The competition for leader of the AU's 54-member Commission was highly contentious, largely pitting French-speaking countries, which backed Ping, against the mostly English-speaking countries that supported Dlamini-Zuma.
Earlier last week, Ping denied a South African media report that said he was planning to withdraw from the race, the BBC reported.
More from GlobalPost: Malaria drugs in Africa are often Chinese fakes, new study says
Some major African nations, like Nigeria and Kenya, had expressed reservations about giving so much power to South Africa, and smaller nations fretted that their interests would be neglected.
The AU has been criticized for being slow-moving, divided and ineffective. Critics point to the AU's lack of diplomatic weight during the recent Libya and Ivory Coast crises.
South Africa's ruling African National Congress party thanked AU members for endorsing Dlamini-Zuma as a "continental candidate," saying her election as AU leader "augurs well for revitalizing unity of the African continent and consolidation of governance and economic integration."
"Her victory has punctuated the need to reposition and refocus the African Union to ensure that it responds to global challenges confronting the continent and to work towards greater unity of the continent," an ANC statement said.
"We believe that in her hands, the AU is safe."
More from GlobalPost: Is South Africa nationalizing its mining industry?