Jacob Zuma’s shortcomings cannot shock anyone; nor can his ability to survive them. Since his election as president of South Africa in 2009, he has ridden out criminal investigations and corruption allegations (he may still face several hundred such charges). Last year the top court ordered him to repay the country for lavish upgrades to his home, and the then ombudsman warned of “state capture” by business interests. His sacking of the respected finance minister Pravin Gordhan in March was followed by further revelations of links between his family and allies and the Gupta business empire, appearing to detail improper dealings in government contracts.

Yet he has seen off multiple no-confidence votes; on some reckonings, Tuesday’s was the eighth of his nine lives. This time, MPs were allowed to vote in secret: dozens of ANC members rebelled, more than expected – but not enough to oust him.

The arguments of Mr Zuma’s loyalists were perhaps the ultimate indictment of the president. Instead of attempting to defend his record, they simply attacked his opponents, portraying the parliamentary vote – tabled by the opposition Democratic Alliance – as an “insurrectionist” attempt at regime change and even a “coup d’etat”.

The fierce loyalty bred by the ANC’s history means some could not countenance handing the opposition a victory, whatever their true feelings. They may hope to muddle through to December (when the ANC is due to choose another leader) or 2019 (when Mr Zuma completes his second and final term as president). His removal would have required them to agree a new president within 30 days, despite the bitter divisions, or head for the polls with the party in disarray. Others hoped to boost their prospects in the succession, or feared turning on him would sink their chances if the ballot did not remain secret. Many have benefited from the patronage networks he created. But anger and shame at Mr Zuma’s conduct run deep within the ANC and its long-term support base. Its anti-apartheid stalwarts are increasingly vocal in their denunciations of Mr Zuma and, along with trade unionists and church leaders, had urged MPs to help rescue the party.

No one can doubt the damage that he has done to his country, nor its need for competent and clean leadership given its challenges. South Africa tipped into recession this year and Mr Gordhan’s sacking triggered the downgrading of its credit rating to junk status. A third of South Africans live on or below the poverty line. Over a quarter are unemployed.

But the damage Mr Zuma has done to the ANC is every bit as substantial. No party is likely to be at its best when it rules unchallenged for two decades. He is a reflection of the ANC’s flaws, and not their sole creator; but he has exacerbated and embedded them. The real issue now is his legacy. He hopes to see his ex-wife, the former African Union commission chief Nkosazana Dlamini-Zuma, succeed him. The party’s deputy, the trade union boss-turned-tycoon Cyril Ramaphosa, is probably the frontrunner; other likely contenders include the parliamentary speaker Baleka Mbete, Lindewi Sisulu – daughter of liberation aristocracy – and Zweli Mkhize, another senior party figure.

Whoever takes over will have to answer for Mr Zuma, and the ANC decision to go along with him – however unhappily – when the electorate gets its say in 2019. Despite the party’s continued dominance, it is already starting to be hit at the ballot box. The opposition will do its best to ensure that no one forgets Tuesday’s vote. The result was a kind of victory for Mr Zuma. But no one could call it a win for the ANC.