NOT so long ago, South Africa was by far the most serious and economically successful country in Africa. At the turn of the millennium it accounted for 40% of the total GDP of the 48 countries south of the Sahara, whereas Nigeria, three times more populous, lurched along in second place with around 14%. The remainder, in raw economic terms, barely seemed to count. Despite South Africa’s loathsome apartheid heritage, solid institutions underpinned its transition to democracy in 1994: a proper Parliament and electoral system, a good new constitution, independent courts, a vibrant press and a first-world stockmarket. Nelson Mandela, whose extraordinary magnanimity helped avert a racial bloodbath, heralded a rainbow nation that would be a beacon for the rest of Africa.

Since then, Africa, once harshly labelled by this newspaper as “the hopeless continent”, has begun to make bold strides (see article). Meanwhile South Africa, though still a treasure trove of minerals with the most sophisticated economy on the continent, is on the slide both economically and politically (see article). By some calculations Nigeria’s economy, messy as it is, will overtake it within a few years. What went wrong with South Africa, and how can it be fixed?

Gathering gloom

In the past decade Africa to the north of the Limpopo river has been growing at an annual average clip of 6%, whereas South Africa’s rate for the past few years has slowed to barely 2%. Rating agencies have just downgraded South Africa’s sovereign debt. Mining, once the economy’s engine, has been battered by wildcat strikes, causing the biggest companies to shed thousands of jobs in the face of wage demands and spreading violence. In August a confrontation at a platinum mine in Marikana, near Johannesburg, the commercial capital, led to 34 deaths at the hands of the police. Foreign investment is drying up. Protests against the state’s failure to provide services are becoming angrier. Education is a disgrace: according to the World Economic Forum, South Africa ranks 132nd out of 144 countries for its primary education and 143rd in science and maths. The unemployment rate, officially 25%, is probably nearer 40%; half of South Africans under 24 looking for work have none. Of those who have jobs, a third earn less than $2 a day. Inequality has grown since apartheid, and the gap between rich and poor is now among the world’s largest.

The ruling African National Congress (ANC) is not entirely to blame. South Africa has performed worse than its African neighbours in recent years partly because its mature economy is linked more tightly to the rich world, and thus to the rich world’s problems. And the ANC has notched up some genuine achievements—including housing and some welfare services often denied to the poor black majority under apartheid. But the party’s incompetence and outright corruption are the main causes of South Africa’s sad decline.

Since Mr Mandela retired in 1999, the country has been woefully led. For nine years it endured Thabo Mbeki’s race-tinted prickliness, so different from Mr Mandela’s big-hearted inclusiveness. Mr Mbeki’s denial of the link between HIV and AIDS cost millions of lives. After he was deposed by his party in 2008, there was a brief stand-in, Kgalema Motlanthe, before Jacob Zuma took over the presidency in 2009.

Mr Zuma arrived with a mixed reputation. He had had a string of close shaves with the law for both grand corruption and squalid sexual behaviour; in his favour were his charm, homespun intelligence and canny ability to mediate between people and the many factions that make up the ANC. But stuck between the impatient masses stirred up by racial populists such as Julius Malema on the one hand, and anxious capitalists and greedy party bigwigs on the other, he has drifted and dithered, offering neither vision nor firm government.

Worse, Mr Zuma has failed to tackle the scourge of corruption. The ANC under his aegis has sought to undermine the independence of the courts, the police, the prosecuting authorities and the press. It has conflated the interests of party and state, dishing out contracts for public works as rewards for loyalty—hence the bitter jest that the government is in hock to “tenderpreneurs”. This has reduced economic competitiveness and bolstered a fabulously rich black elite. As a result, too little wealth trickles down.

Nearly two decades after apartheid ended, South Africa is becoming a de facto one-party state. The liberal opposition—the Democratic Alliance (DA), led by a doughty white woman and former anti-apartheid journalist, Helen Zille—has the right ideas, calling above all for the ANC to respect the constitution. The DA has made electoral gains, climbing to 17% of the vote in the last general election in 2009 and 24% in local elections last year. It runs Cape Town and the encompassing Western Cape province better than the ANC runs most of the rest of the country. But most blacks see the DA as too white, and still have a deep-seated loyalty to the ANC—whatever its failings—as the party of Mr Mandela and liberation. That still gives the ANC over 60% of the vote. For the foreseeable future the DA has no earthly chance of national power.

Call for competition

Some simple changes could help spur change and integrity. One of the parliament’s worst features is its party-list method of choosing members, who are thus entirely in thrall to ANC bosses rather than to the voters: a constituency-based system would make them more accountable. Although the ANC still has no obvious alternative leader, the party should look to chuck out Mr Zuma when it holds a party election in December, though pollsters consider that unlikely.

Most of all, South Africa needs political competition. Its neighbours to the north are moving away from the one-party systems that dragged them to corruption and stagnation for decades. South Africa is heading in the opposite direction. The best hope for the country in years to come is a real split in the ANC between the populist left and the fat-cat right to offer a genuine choice for voters. Until that happens, South Africa is doomed to go down as the rest of Africa goes up.