JOHANNESBURG — Mamphela Ramphele, a prominent veteran of the struggle against apartheid, raised great expectations in early 2013 by entering politics and starting a new party. A black woman who had two children with Steve Biko, the anti-apartheid martyr, and went on to forge a formidable career as a medical doctor, business executive and managing director at the World Bank, she seemed such a compelling candidate that South Africa’s main opposition group even proposed a merger with her fledgling party.

But Ms. Ramphele, 66, failed spectacularly in the general elections in May, with her party picking up a mere two seats. After months of recriminations and increasingly fierce internal fighting, Ms. Ramphele made official on Tuesday what was already clear to most South Africans: that she was done and quitting politics altogether.

Ms. Ramphele’s short-lived political career was the latest failure by former allies of the governing African National Congress to mount a challenge to its overwhelming dominance. She said she would return to her previous work in civil society.

Ebrahim Fakir, an analyst with the Electoral Institute for the Sustainability of Democracy in Africa, said that poor management had doomed Ms. Ramphele’s party, Agang. Her potential, Mr. Fakir said, was exaggerated by “the news media’s desire for an alternative to the A.N.C.”