In her final hours before leaving her job as South Africa's most fearless anti-corruption crusader, Thuli Madonsela faced the usual assortment of enemies.
President Jacob Zuma's lawyers were in court, trying to suppress her latest report. A powerful business family had unleashed its propaganda machinery against her, and its lawyer was threatening her with "peril." And a mysteriously well-funded crowd of demonstrators was shouting furiously at her gates, blowing vuvuzelas and denouncing her.
Ms. Madonsela, the 54-year-old daughter of working-class parents from Soweto township, has emerged as South Africa's most popular hero since Nelson Mandela.
A columnist has called her the greatest public servant in South African history. Even a leader of the ruling party, the African National Congress, said she had "saved us from ourselves."
Inside her besieged office, speaking in a voice barely above a whisper, Ms. Madonsela smiled calmly and explained how she had outfoxed her foes. She revealed that she had already written her final report – a potentially explosive probe into Mr. Zuma's links to the Gupta business family – and sent it away for safekeeping until its release.
On Sunday, South African media revealed why Mr. Zuma and the Guptas were so afraid of her. They published a list of the questions that Ms. Madonsela had submitted to Mr. Zuma, showing a web of links between the president and the business family.
At midnight on Friday night, she completed her seven-year term as Public Protector – a constitutionally empowered watchdog who investigates government misconduct and has the power to force resolutions. Her supporters have dubbed her the "people's protector," in recognition of her extraordinary legacy of revelations about corruption and wrongdoing.
It was Ms. Madonsela who published a scathing report on the millions of dollars in state funds that were spent on Mr. Zuma's palatial village home, triggering a scandal and a court ruling that found Mr. Zuma to have violated the Constitution.
That was just one of many reports in which she exposed misconduct by some of South Africa's most powerful officials, from police chiefs to television bosses, forcing the resignation of at least two cabinet ministers. At a time when the country often despairs of graft and theft, Ms. Madonsela has offered a glimmer of hope that its post-apartheid democracy is still strong.
Ms. Madonsela was born in 1962, just two years after the Sharpeville massacre, one of the worst atrocities of the apartheid era. Her parents were informal street traders in Soweto, often harassed by apartheid police. She was a student at the time of the Soweto uprising, when police were killing student protesters in the township where she grew up. As a teenager, she says, she was "socially awkward, plagued by a nagging feeling of being unloved and ugly."
But by 1994, after obtaining a law degree and turning down a Harvard University scholarship, she was serving on a legal team that helped draft South Africa's post-apartheid Constitution, one of the most widely respected in the world.
She worked for trade unions, the justice department and the national law-reform commission, until Parliament voted unanimously in 2009 to appoint her as Public Protector – a post that had been relatively low profile before her. She transformed the position, becoming a bold anti-corruption fighter with such popularity that her fans often call for her to run for president. (She denies any political ambitions and plans instead to teach and write a book.)
It hasn't been easy. Many politicians, furious at Ms. Madonsela's investigations, have sought vainly to tarnish her. Some have even alleged that she is a secret agent of the U.S. Central Intelligence Agency – a laughably absurd charge.
Last May, she was warned of an assassination plot against her, and her security detail was reinforced. At her final press conference on Friday, she shrugged off the risks. "There were concerns, but honestly, we're all going to die," she said. "If it's your time to go, it's your time to go."
The pressures intensified after she agreed to investigate the country's biggest political issue: the allegation of "state capture" by the Gupta brothers, who have reportedly gained so much political power that they even control Mr. Zuma's cabinet appointments. The Guptas won government contracts and forged a vast business empire after giving a senior post to Mr. Zuma's son.
As the probe moved closer to the President, Mr. Zuma's proxies – including the ANC youth league and women's league – have lashed out at Ms. Madonsela. The youth league called her a "drama queen" who "vandalizes the name of the President." The women's league accused her of pursuing a "narrow politically motivated investigation."
A lawyer for the Gupta family, meanwhile, threatened her with unspecified "peril" if she released her "state capture" report before the end of her term. Two media outlets owned by the Guptas launched a vicious propaganda campaign against her. And the vuvuzela-blaring protesters at her gates, an obscure group of radicals who had suddenly found enough money to pay for large newspaper advertisements, accused her of being an "agent of white capital."
Legally, she could have released her report on Friday, since the Zuma application for a court injunction hadn't yet been heard. But she decided it would be more ethical to wait for the court decision.
"Just because we deal with underhanded people, it doesn't mean we too should be underhanded," she said pointedly.
She noted that Mr. Zuma had twice scheduled meetings with her in which he had promised to respond to her questions – and both times he changed his mind and refused to answer, demanding more time.
South Africa's newly appointed Public Protector is Busisiwe Mkhwebane, a long-time civil servant who has been criticized for her stint as an employee of the national spy agency. It remains to be seen whether she will be as energetic and fearless as her predecessor.
In one of her final reports, Ms. Madonsela exposed the unfair dismissal of Nomonde Mapetla, an official who had blown the whistle on misconduct at a public agency. At the press conference on Friday, the whistleblower took the microphone to express her gratitude to Ms. Madonsela for defending her against the Goliaths of government. "Thank you for being my David," she said.