Updated

As scandal after scandal unfolded, South African President Jacob Zuma maintained an affable demeanor in public, rallying his support base, dispatching lawyers to fend off court challenges and, it is alleged, enabling his corrupt associates.

Finally, the astute political operator whose on-stage dancing and singing delighted loyalists ran out of options, his reputation shattered by revelations of systemic graft in government. Abandoned by once-steadfast allies in the ruling party, Zuma was forced to resign Wednesday, ending a presidential tenure of nearly a decade, much of it marred by questions about his conduct and character.

Zuma has denied any wrongdoing. But the steady flow, and then flood, of allegations of impropriety on his watch reinforced a sense that South Africa had failed to live up to the hopes of its young democracy when apartheid ended in 1994.

Certainly, South Africa's economic inequity and other sweeping problems could not be pinned on any one person, and Zuma could point to significant improvements since the end of white minority rule, including during his presidency. But the culture of corruption and impunity that flourished in his orbit could take years to overcome.

As public opinion turned against Zuma, some members of the ruling African National Congress party began to see him as a risk to its hold on power ahead of 2019 elections. His appearances in parliament turned chaotic as protesting opposition members were removed from the chamber.

The growing discontent over Zuma was evident in 2013 when mourners booed him during a Johannesburg stadium memorial for Nelson Mandela, South Africa's first black president and global statesman.

Before that, Zuma had presided over one of democratic South Africa's proudest periods — the staging of the World Cup soccer tournament in 2010. He was also leader during one of the most horrifying events — the fatal shooting by police of several dozen protesters during labor unrest at a platinum mine in Marikana in 2012.

Despite his fumbles and periodic scandals, Zuma was remarkably resilient and showed a deft touch during his career. In 2007, he beat then-President Thabo Mbeki in a race to lead the ANC party, opening the way for him to become president in 2009.

Zuma, 75, was born in what is now Kwa-Zulu Natal province, which later became a bed rock of support for the ruling party. South Africa was in the grip of apartheid during his youth, and he joined the armed wing of the ANC in 1962 after the anti-apartheid movement was banned.

He was soon arrested and spent a decade on Robben Island, the prison where Mandela was held for many years. After his release, Zuma resumed his anti-apartheid activities, later working as head of the intelligence section of the ANC.

After the party took power in the first all-race elections in 1994, Zuma gradually worked his way to the top of its leadership.

He was popular among some South Africans for his personal warmth and populist policies, and some applauded him for embracing what they saw as traditional African values in his personal life.

He had four wives and more than 20 children, according to the website of the South African presidency. Polygamy, though, is not widely practiced and was seen by some as old-fashioned. Additionally, there were questions about what kind of example he was setting by having multiple, concurrent sexual partners in a country that was enduring an AIDS epidemic.

In 2006, while being tried on charges of raping an HIV-positive family friend, Zuma was widely criticized for testifying he took a shower after extramarital sex to lower the risk of AIDS. He was acquitted of rape.

Still, Zuma called for earlier and expanded treatment for HIV-positive South Africans and urged his countrymen to get tested for HIV.

One of the biggest scandals to hit the president involved Zuma's private Nkandla residence, where more than $20 million was spent for alleged security upgrades that, according to the state ombudsman, were financially "excessive and obscene."

Zuma later paid back some of the money.

His relationship with the Gupta family of Indian immigrant businessmen also drew widespread public anger. Emails leaked to South African media last year detailed how the Guptas attempted to use their proximity to the president to influence political appointments and secure business contracts for their sprawling media, mining and technology conglomerate.

Both Zuma and the Guptas denied wrongdoing, but voters registered their dissatisfaction. The ANC had its worst showing at the polls in municipal elections in 2016, seeing its vote share fall below 60 percent for the first time and losing control of key cities, including Johannesburg and the capital, Pretoria.

Zuma now faces the possible reinstatement of corruption charges tied to an arms deal two decades ago.

In December, even as his tenure as the leader of the ruling ANC was coming to an end, Zuma remained defensive in the face of scandal, saying that "being black and successful is being made synonymous to being corrupt."

The newly elected ANC leader, Cyril Ramaphosa, quickly made high-profile statements against corruption — and held private talks in recent days with Zuma on a power transition. As deputy president, Ramaphosa became the acting head of state after Zuma resigned and is expected to be elected as president by the ANC-dominated parliament and deliver a delayed state of the nation address by the end of the week.

At rallies, Zuma was known for singing a defiant anti-apartheid song that refers to a machine gun. But as opposition to him grew in recent years, a slogan became prominent in the South African lexicon, whether in parliament or on social media: "Zuma must go!"

___

Follow Christopher Torchia on Twitter at www.twitter.com/torchiachris