South Africa's parliament voted against a motion of no confidence in President Jacob Zuma by just over 20 votes Tuesday.

Despite the fact that Zuma remains president, the 177-198 vote sends a strong message that there is a crisis within the ruling African National Congress party, or ANC, and signals that his position within the party has been severely weakened.

South African politics are, if anything, certainly unpredictable. In the 23 years of its democracy, there have been both surprises and disappointments. In particular of late there has been mounting public concern over Zuma's performance amid a string of serious corruption allegations.

Get Breaking News Delivered to Your Inbox

But despite the frenzy the nation's urban middle class managed to spin itself into ahead of Tuesday's vote and the dramatic headlines describing the nation as sitting on a knife-edge, there was no knife – although this time the blade came very close.

There have been seven attempts to oust Zuma from office, including three previously unsuccessful opposition party-led votes of no confidence.

This latest motion comes after Zuma fired his finance minister, the widely respected and fiscally responsible Pravin Gordhan. Gordhan is a veteran member of the ruling class but was openly critical of Zuma, accusing him of rampant corruption that has enriched both himself and his acolytes.

The difference with Tuesday's vote was that it was cast in secret. Members of the ANC were able to vote according to their conscience without fear of reprisal if they rebelled against the party's instruction to support Zuma. Some senior members of the ANC have been openly hostile to Zuma and criticized him publically, saying he should resign over the corruption claims.

The decision to allow the secret ballot sat with Speaker of the House Baleka Mbete, a longtime Zuma supporter with presidential ambitions of her own. Mbete did what was‚ up to now‚ unthinkable for a top ANC official: She rolled the dice on Zuma's fate. By allowing members of parliament to vote in secret on the no-confidence motion‚ the ANC did not have complete control of the outcome.

The ANC simply had to trust that the instructions hammered into its caucus ahead of the vote would be enough to prevent its members from breaking ranks.

Mbete provided a detailed explanation for her decision at a media briefing just 24 hours ahead of the vote‚ quoting at length from a June Constitutional Court judgment granting her the discretion to decide on the voting method.

By delaying the announcement until the 11th hour‚ it was widely anticipated that she would choose an open ballot and was trying to limit the time available for any urgent court action against her decision by opposition parties.

But Mbete stunned the country when she said she had taken "due and impartial consideration of all the factors" and decided that voting on the motion would be by secret ballot. She also mentioned that it became necessary to vote in secret when "circumstances are toxic," referring to threats against ANC MPs who had said they would vote according to their conscience.

But what this shows even more clearly is that Mbete and others are worried about their own political fate. They want to remain in top positions within the ANC, which has its national elective conference in December, and they may no longer have or even want Zuma's help. He has become tainted goods.

Clearly the number of people within the ANC willing to throw themselves under the bus for him is diminishing. Although it's doubtful that Mbete ever believed the no-confidence motion would be successful, she is hedging her bets in showing a willingness to disobey Zuma.

However, even with the secret ballot‚ the numbers always weighed in favor of Zuma. The ANC controls 249 seats in the 400-member parliament. A simple majority was all that was needed to win. On Tuesday, 384 people voted, but the ANC won narrowly given its huge majority, defeating the motion 198-177.

What this reveals is that support for Zuma within his own party is waning. Zuma cannot be pleased with this result as it is not the stunning outright victory he had hoped for. A significant number of ANC members crossed the floor and with the security of secrecy rebelled against their leader.

South Africa does not have presidential elections – the ruling party chooses the leader. And the country's constitution dictates that a president can only have two terms in office. Zuma's second term expires in 2019, but at the end of this year his party holds its elective conference. The person chosen as leader of the organization in all likelihood will be the country's next president.

As Zuma's support declines, so does his ability to influence the choice of his successor. He wants his former wife, Nkosizana Dhlamini-Zuma, to be the next ANC president. Analysts say this is because he believes she would not allow any criminal charges of corruption to be brought against him.

But Dhlamini-Zuma is facing tough opposition from Deputy President Cyril Ramaphosa, a former-trade-unionist-turned-businessman who was a close associate of former President Nelson Mandela helping steer the country's constitutional negotiations for democracy.

Expect more unpredictability in South African politics over the next six months. After years of being the ultimate Teflon man, Zuma can no longer count on unconditional support. He heads into that December ANC elective conference significantly bruised and weakened.