MIDDELPLAAS, South Africa — The little girl hated going to the bathroom at school. The pit toilets were so dark, dirty and crumbling. Many children were so afraid of them that they simply relieved themselves in the schoolyard to avoid the ordeal.

But as she played with her best friend during recess, the girl, Ziyanda Nkosi, a 6-year-old first grader, really had to go. She stepped warily inside the closet-like latrine.

Even with the gentle pressure of her tiny frame, the floor caved in. Ziyanda flailed wildly, clinging to the edges of the hole, frantically trying to keep herself from falling in and drowning in the fetid pool below.

“Mommy! Mommy!” she screamed, managing to hold on long enough for an older boy to run in and save her.

Hundreds of parents, enraged that their warnings about the dilapidated school had been ignored for years, burst into protest a couple of days later, upending their quiet rural town for two weeks last August. They burned tires, blocked roads and demanded justice from the provincial government led by David Mabuza, a former math teacher who had become one of the most powerful figures in the African National Congress and was positioning himself to become South Africa’s deputy president.

One of the party’s historic promises had been to provide a good education for black people, who had been deliberately denied the opportunity under apartheid. A.N.C. leaders like Nelson Mandela often spoke about freeing black South Africans through school, and Mr. Mabuza, whose first big post in the province was education minister, got his political start by promising just that.

Image

David Mabuza, left, congratulating Cyril Ramaphosa, now South Africa’s president, on being named leader of the African National Congress in Johannesburg last December.CreditJoao Silva/The New York Times

But under the A.N.C., the education system has been in shambles, so gutted by corruption that even party officials are dismayed at how little students are learning, in schools so decrepit that children have plunged to their deaths in pit toilets.

The rage in Ziyanda’s town grew so intense that protesters hurled stones at a local A.N.C. leader, who narrowly escaped by whipping out his handgun and shooting randomly into the crowd, wounding two children and roiling the community all the more.

Mr. Mabuza never came to the school or met with the parents — and for good reason, local officials contend. The dangerous conditions were a clear reflection of his control over the province, where millions of dollars for education have disappeared into a vortex of suspicious spending, shoddy public construction and brazen corruption to fuel his political ambitions, according to government records and officials in his party.

But the uprising and allegations against Mr. Mabuza did not crimp his political rise. To the contrary, only a few months later, as the A.N.C. tried to quash national outrage over misrule by its leaders, Mr. Mabuza scored his biggest triumph by far. He was picked to become second-in-command of the entire A.N.C., launching him into an even more prominent post — as South Africa’s deputy president, second only to the nation’s leader.

Mr. Mabuza may seem an odd choice, especially at a time when the A.N.C. is desperate to purge its reputation for graft and restore its image as the rightful heir to Mr. Mandela’s legacy. After all, Mr. Mabuza’s rural province, Mpumalanga, is fairly small, has little economic clout and is widely regarded as one of the country’s most corrupt.

But that is the vexing secret behind Mr. Mabuza’s spectacular climb, current and former A.N.C. officials say: He siphoned off money from schools and other public services to buy loyalty and amass enormous power, making him impossible to ignore on the national stage and putting him in position to shape South Africa for years to come.

“He didn’t become what he is now because of his political capability,” said Fish Mahlalela, a senior A.N.C. figure in the province and a national lawmaker.

“No, no, it was out of money and the manipulation,” he added. “Nothing else.”

Image

Fish Mahlalela, a senior provincial A.N.C. figure, said of Mr. Mabuza, “He didn’t become what he is now because of his political capability.”CreditJoao Silva/The New York Times

Perhaps more than any other member of South Africa’s new government, Mr. Mabuza undercuts the promise of a “new dawn” in the country after the removal of President Jacob Zuma this year.

Besieged by scandals that have hacked away at the A.N.C.’s legitimacy and electoral prospects, the party installed a new president, Cyril Ramaphosa, in February. From the start, he pledged to root out corruption and finally deliver on the promise of a just South Africa for all of its citizens.

But to seal his new post, Mr. Ramaphosa first had to secure the backing of Mr. Mabuza, 57, who built such a formidable political machine that he became kingmaker in the back-room negotiations to choose South Africa’s new president. After campaigning for a rival, Mr. Mabuza abruptly switched sides and joined forces with Mr. Ramaphosa, helping the two emerge from a pivotal party conference last December as the country’s undisputed leaders.

Then, to the surprise of many in his province, Mr. Mabuza gave a speech just weeks after being sworn in as deputy president this year, lamenting the poor state of the schools and the “tragedies that take away the innocence of our children.”

He spoke movingly of a kindergartner electrocuted at school. Of a toddler who drowned after falling into a broken pit latrine. And of a 5-year-old boy whose body was discovered by his mother at the bottom of another dilapidated pit, his hand sticking out of a pool of feces.

Such deplorable conditions were all too common, he noted, symbolizing the failure to provide black South Africans with a decent chance at life.

“Where is our care?” Mr. Mabuza said in the speech. “What has gone wrong with our nation?”

Yet under Mr. Mabuza’s leadership, millions of dollars for schools in his province have been misspent year after year, according to the national government. His province routinely spent less on poor students than required, and school construction projects have been riddled with inflated costs, government records show.

Nearly a quarter of the primary schools in Mr. Mabuza’s province still have only dilapidated pit toilets, despite ample government funds to fix them. And during his tenure, his province was caught fabricating the passing rates on the annual national exam, enabling him to claim big leaps forward that never happened.

Image

A dilapidated toilet in Middelplaas.CreditJoao Silva/The New York Times

The schools Mr. Mabuza did champion provided an easy way to funnel large amounts of money into politics, according to A.N.C. officials, high-ranking defectors and anticorruption groups. He pushed to build big boarding schools whose costs tripled, for unexplained reasons, to $30 million each, alarming education experts. Some construction was so shoddy that roofs sprouted leaks soon after being finished, toilets barely worked, students lacked water, retaining walls collapsed and dormitories were missing doors, according to a provincial report.

Over the years, Mr. Mabuza’s province also became known as one of South Africa’s most dangerous. Nearly 20 politicians, most from inside the A.N.C., were assassinated in the past two decades, some after exposing graft in public works projects.

All the while, Mr. Mabuza’s political career flourished. He attracted legions of new A.N.C. members with government contracts, cash handouts and even KFC meals, according to current and former party officials.

His sweeping recruitment drive turned his relatively insignificant province into the A.N.C.’s second-biggest voting bloc. Under the party’s delegate system, his territory became more influential than even Gauteng, the province that includes Johannesburg and Pretoria, with a population three times the size and an economy nearly five times as big.

Now, critics contend, Mr. Mabuza’s role as the second-most powerful politician in the country casts doubt on the legitimacy of the new government and its bold assertions that the A.N.C. is turning the page on corruption.

Under the A.N.C., Mr. Mandela’s once heralded liberation movement, tens of billions of dollars meant to lift poor black South Africans have been stolen by party leaders. Strong institutions like the tax agency have been hollowed out by party officials bent on shielding their illicit activities.

But the nation’s poor schools are perhaps the A.N.C.’s greatest betrayal of the dreams of black South Africans — some of whom have turned to burning down schools in protest.

Mr. Mabuza, who declined to be interviewed, built his political career on the schools. Unlike other, more celebrated anti-apartheid leaders, he did not go into exile; he was not imprisoned on the infamous Robben Island. Instead, he fought for the right of black South Africans to receive an equal education, a call he echoed in his recent speech.

But the schools also offered him a rich political opportunity, officials say. Education represents about half of provincial budgets, followed by health. Officials from the National Treasury recently warned in a parliamentary hearing that misspending and mismanagement in Mr. Mabuza’s province were especially rampant in those two departments.

The consequences are evident not only in Mpumalanga, Mr. Mabuza’s province, but across South Africa, where corruption has run through every layer of the education system. Less than a quarter of South African children in fourth grade understand what they read, according to an international literacy test. In sub-Saharan Africa, where South Africa’s economy is by far the most advanced, children in countries like Kenya, Botswana and Swaziland do better in math and reading.

As many South Africans pin their hopes on Mr. Ramaphosa’s pledge for a fresh start, analysts say that much of the country is looking past an unpleasant truth: The new president owes his victory in part to corruption, and much of his administration’s future — as well as the country’s — rests in the hands of Mr. Mabuza.

“If there is any powerful person whom Ramaphosa’s presidency actually relies on, it is Mabuza,” said Ralph Mathekga, the author of “Ramaphosa’s Turn: Can Cyril Save South Africa?”

“We are being reluctant as a nation to face the reality of Mabuza,” he added. “If Ramaphosa gets hit by a bus, Mabuza is going to be the president.”

Scandal From the Start

Image

Class time at Mpumelelo Primary School.CreditJoao Silva/The New York Times

The numbers just didn’t add up, even at the beginning.

After apartheid ended in 1994, Mr. Mabuza got his first big break: He became Mpumalanga’s education minister, a chance to shape the schools and generations of students attending them.

He had the perfect résumé. The son of farmers, Mr. Mabuza grew up here in the province, walking miles from his village to the only primary school in a nearby town. Though he often had no shoes, he always tucked in his shirt and buttoned it up to the neck, recalled Reginah Mhaule, a childhood peer.

“He was never late,” said Ms. Mhaule, a longtime ally who recently became one of South Africa’s two deputy foreign ministers.

A bright student, Mr. Mabuza ultimately took one of the few jobs available to black South Africans back then. He taught math at the local high school and later became a founding leader of a teachers’ association.

Poor schooling was a major spark in the anti-apartheid movement, most notably in Soweto in 1976, when thousands of students protested the introduction of Afrikaans as the language of instruction. In Mr. Mabuza’s province, teachers and students began organizing against white-minority rule in the early 1980s.

Image

Orlando High School in Soweto in 1977, one year after protests against the use of Afrikaans as the language of instruction in township schools.CreditAgence France-Presse — Getty Images

“The teachers were at the center” of the movement, said Sandile Sukati, a teacher who recruited Mr. Mabuza into the main student organization. Mr. Mabuza quickly stood out, he said, traveling far and wide to build ties among anti-apartheid groups.

“He was a leader in his own right,” Mr. Sukati said.

But after apartheid ended, Mr. Mabuza quickly ran into trouble, leading to the province’s first big scandal of the democratic era.

In 1997, three years into his tenure as education minister, the schools were performing poorly, especially on the national obsession: the annual matriculation exams that determine whether students graduate from high school. The passing rate in his province was 46 percent that year, slightly below the national average.

Mr. Mabuza was feeling the pressure, particularly as powerful A.N.C. leaders returned from exile, often with military credentials that overshadowed his own, several current and former A.N.C. officials said.

“I am in a tight situation,” Mr. Mabuza told some of the teachers, recalled Mr. Sukati, who worked under Mr. Mabuza at the education department.

The next year brought a stunning improvement. The passing rate inexplicably jumped to 72 percent — an incredible turnaround that catapulted Mpumalanga to No. 2 among the nation’s nine provinces.

“I was suspicious,” said Mr. Sukati, who is now a senior education official. “It couldn’t just happen like that.”

A whistle-blower exposed the cheating a few weeks later. The real passing rate, the authorities announced, was under 53 percent. Moreover, the doctoring had taken place inside Mr. Mabuza’s residence, where he met with a small circle of bureaucrats, some of whom were later fired, current and former A.N.C. officials said.

An investigation was never completed. Mr. Mabuza never admitted wrongdoing or suffered any significant consequences. Dropped as education minister, he was named head of housing instead.

Image

One of the A.N.C.’s historic promises was to provide a good education for black people, who had been denied the opportunity under apartheid.CreditJoao Silva/The New York Times

Ever since, Mr. Mabuza’s career has been remembered for that scandal, one that helped establish the kind of culture of impunity in his province that has tarnished the A.N.C. across South Africa, current and former party officials say.

“I think, the man, he had to be charged, but unfortunately I don’t know what went wrong,” said Ronnie Malomane, an A.N.C. official who was taught math by Mr. Mabuza in the early 1980s. “They were just giving him position after position.”

Nationally, Mr. Mabuza’s standing kept rising, propelled by his success at attracting new party members. In 2009, Mr. Zuma appointed him premier of all of Mpumalanga province.

But Mr. Mabuza raised more red flags, stripping some of the decision-making power over government projects from local officials and concentrating it in his own office. He justified the move — called the “Rapid Implementation Unit” — as a way to act quickly. Others had a different explanation.

“That’s how he managed to loot,” said Collen Sedibe, a former A.N.C. leader who grew up on the same street as Mr. Mabuza and worked under him in the provincial housing department.

Treasury officials in the province say they are now investigating the irregular expenditures “incurred through the contracts arranged centrally by the Office of the Premier.”

But parents, officials and educators had warned about the damage from corruption and neglect for years, pointing to the painfully overcrowded classrooms and decaying, apartheid-era schools.

“We are teaching because we have to teach, but proper teaching and learning is not taking place,” said Bernard Shakwana, a teacher at Ziyanda’s school, Mpumelelo Primary. Last year, he tried teaching the 60 students in his class under a tree because deep cracks in the school walls and floors suggested that the building might collapse.

Tifonto Masuku, who taught at the school for 35 years, said she retired early because the conditions had become unbearable. The quality of education had suffered so much that she considered it even worse than under apartheid.

“All this is because of the A.N.C.,” Ms. Masuku said. She now runs a butcher shop.

‘They Wanted to Kill Me’

Image

Some in South Africa see a cynicism behind the schools’ conditions. When black South Africans become educated and middle class, their loyalty to the A.N.C. tends to wane.CreditJoao Silva/The New York Times

It took four days of rage before the local A.N.C. councilor showed up.

The councilor, Justice Twelve Siboza, explained that he had been busy the week Ziyanda fell into the toilet, tending to another corner of his ward. Other activities had also drawn his attention: He is a gospel singer with his own radio show, so he crisscrosses the region to perform at weddings and funerals.

He certainly understood the parents’ anger, he said. During the 1980s, he walked more than six miles a day to school, skipping bus fare to save enough money to eat.

But these days, he said, most students graduate without a command of the English language, dooming their job prospects.

“The foundation before was better,” he said of the quality of education in the province.

By the time he got to Ziyanda’s school, hundreds of parents had closed off the unpaved roads, furious that their grievances had been met with near silence from the A.N.C.’s leaders.

Mr. Siboza made sure to bring a gun.

Politics is dangerous in South Africa, sometimes lethal, he said. “You must stay with him,” he said of his gun.

Image

Justice Twelve Siboza, an A.N.C. councilor, injured two students when he fired his gun at a school protest.CreditJoao Silva/The New York Times

The A.N.C. has a grip on the area around the school because most residents, aside from the lucky few working at the sugar cane plant, are poor and rely on the party for government jobs, contracts or monthly welfare grants.

It is an area Mr. Mabuza knows well. He began his ascent inside the A.N.C. as the head of this part of the province. It was once part of a homeland set aside for black people by the apartheid government. To this day, several A.N.C. officials said, Mr. Mabuza has kept a hold on it through powerful proxies.

Some see a deep cynicism behind the conditions in the schools. When black South Africans become educated and move into the middle class, their loyalty to the party tends to wane, recent elections have shown. So by perpetuating a culture of dependence, critics contend, the A.N.C. ensures its dominance.

But Ms. Mhaule, the childhood peer of Mr. Mabuza, rejected any suggestion that the A.N.C. had failed to prioritize education.

Before becoming deputy foreign minister, she served as Mr. Mabuza’s education minister in the province for nearly a decade. The A.N.C., she said, had built schools in every corner of the country, making education accessible to all. The government gives students meals, books and, to the poorest, free education. It also issues monthly grants to children, pensions to the elderly and free houses to many, she said.

She dismissed the argument that education had been as good, or better, during apartheid, calling it a false depiction of the nation’s brutal past.

“If you know the Bible, the story of the Egyptians moving from Egypt to Canaan, when they were faced with the Red Sea, they said, ‘Why did you take us out of Egypt? It was good there,’” she said.

Officials like Ms. Mhaule say the rising pass rate on the national high school exam provides clear evidence of progress. But the figures can be misleading. The number of students taking the exam has declined in the past two years. Weaker students who would drag down the rate are being held back, education experts say.

About 600 protesters gathered at the school that cold Friday morning when Mr. Siboza, the local A.N.C. councilor, arrived with a police escort. As he moved to talk to the parents, demonstrators showered him with rocks.

“They wanted to kill me,” the councilor said.

Mr. Siboza made a run for it, reaching for the hip holster under his brown overcoat. He took out his gun — firing three times and hitting two teenagers, a girl and a boy.

Image

Lwazi Thobela, shot in the arm, was one of the students injured by Mr. Siboza.CreditJoao Silva/The New York Times

Agreement Mashele, the school board chairman, was shocked. “This man is a church member,” he said.

A few days later, the A.N.C. councilor visited the children he had wounded.

“The councilor said he was very sorry,” said the girl, Siphesihle Ngobeni, whose left leg was grazed by a bullet. The councilor pleaded with her not to press charges and gave her about $15, she said. She used the money to buy sanitary pads.

The boy’s injury was more severe. His father, Petros Thobela, who had gone to the same primary school and did not have a job, accepted a similar apology and compensation of, according to the councilor, about $150.

The boy’s mother, Nobuhle Ndlovu, who does odd jobs, deplored the state of education.

“They promise,” she said, “and they just disappear.”

Still, she would remain loyal to the governing party.

“Yes, of course, I vote A.N.C.,” she said. “It’s our freedom.”

‘He Always Had Money in His House’

Image

When costs are suspiciously high and schools poorly built or maintained, A.N.C. officials say, it is often a warning that money is being skimmed.CreditJoao Silva/The New York Times

The protests spilled into September, but the country’s attention was fixed on another battle: the national push to replace Mr. Zuma as South Africa’s president.

The all-important A.N.C. party election was only a few months away, and officials in Mr. Mabuza’s province were bracing to see whether his years of hard work had paid off.

In early October, the A.N.C. released the delegate breakdown, with good news for Mr. Mabuza: His previously low-ranking province was now the A.N.C.’s second-most powerful.

Mr. Mabuza owed his outsize influence to a single feat. In the past decade, A.N.C. membership in his province had skyrocketed nearly 190 percent, eclipsing the national increase of less than 60 percent. No other province came close to matching Mpumalanga’s explosive growth.

But Mr. Mabuza’s numbers were as cooked as his high school passing rates, current and former A.N.C. officials contend.

In South Africa, taxes are collected by the national government, which distributes the money to provinces. The provinces then use the money — with little oversight from above.

Treasury officials in Mpumalanga say that “irregular expenditures” more than doubled in the previous two budget years, particularly in education, housing and health.

Wages account for most of the education and health budgets. So money is usually siphoned off by politicians and business allies through contracts for services or construction, A.N.C. officials say. When costs are suspiciously high, schools are poorly built or facilities are badly maintained, they say, it is often a warning that money is being skimmed, at the students’ expense.

Image

Lattie Lubisi, center, is head mistress of the Mpumelelo Primary School.CreditJoao Silva/The New York Times

As premier, Mr. Mabuza promoted the construction of big boarding schools, or mega schools, in farm areas to improve rural education. Since 2012, the province has completed five, with two more in the pipeline.

For reasons that have not been explained, the price of each school has ballooned from $11 million to around $30 million.

But other officials say the mega schools were overpriced projects to reward Mr. Mabuza’s allies and finance his A.N.C. membership drive.

Mr. Mabuza “decided that they’re going to build mega schools because that’s where the money is,” said Mr. Mahlalela, the senior A.N.C. official. “These small schools where there’s a crisis of 16 toilets, it’s not a big sum of money. So it’s not easy to steal.”

With the money Mr. Mabuza amassed, current and former A.N.C. officials said, his operatives signed up supporters by providing jobs, money or even just lunch, illegally inflating the party’s membership rolls by paying people’s annual dues with government money.

Mr. Malomane, the A.N.C. official who learned math from Mr. Mabuza in high school, said his former teacher used other tricks to exaggerate the ranks of party loyalists, like “cloning,” in which one person appeared on several party membership rolls at once.

On Mr. Mabuza’s farm in Barberton, south of the provincial capital, his power was on full display, current and former A.N.C. officials said. He received contractors and took his cut before projects were awarded, they said. Those who refused to participate often faced exile.

Mr. Sedibe, his former ally, recounted how young party workers went to the farm for wads of cash from Mr. Mabuza — often about $750 — to wage his recruitment drive.

“He always had money in his house,” said Mr. Sedibe, who is now an opposition leader.

A Government in Trouble

Image

Temporary pre-fabricated classrooms at Mpumelelo Primary School.CreditJoao Silva/The New York Times

Mr. Mabuza — known as “D.D.” back home — was sworn in as deputy president in February. “His passion,” reads his official biography, “still remains in education.”

Minutes after the swearing-in, he faced questions about corruption and political killings in his province. “There’s nothing to set straight,” he told the national public broadcaster.

“I’m here to serve South Africans,” he added. “Let’s give this government a chance.”

He beamed: He now served under President Ramaphosa, who had served under President Zuma, who had served under President Thabo Mbeki, who had served under President Mandela. All of them, except for Mr. Mandela, were forced out by their successors.

Asked whether Mr. Mabuza would lead the nation one day, Ms. Mhaule, his former education minister, sounded confident.

“He may,” she said. “He will. Not he may, he will.”

As Mr. Ramaphosa, who declined to be interviewed, struggles to unite the A.N.C. and overcome corruption, Mr. Mabuza has vowed to “protect” the president.

“He is very safe with me next to him,” Mr. Mabuza has said.

But back in Mr. Mabuza’s province, the government is in trouble. The two biggest departments in the budget — education and health — are plagued by mismanagement, the National Treasury says. The health department is at risk of being taken over by the provincial treasury. Political killings have resumed.

“The center does not hold anymore,” said Mr. Sedibe, the former A.N.C. leader.

In June, residents furious over poor government services set four schools on fire.

“Where are the children going to learn?” asked Sdudla Mlambo in a township called Matsulu.

The night before, a fire tore through six classrooms in her granddaughter’s school. Yellow tape cordoned off the site.

A neighbor, Jessica Sibiya, a 17-year-old high school student, said she used to attend the school. But with Mr. Mabuza’s ascent, she said with a smile, things were looking up. Surely his hour would come.

“I’ll be happy if D.D. becomes president,” she said. “He’ll help this province.”

A version of this article appears in print on , Section A, Page 1 of the New York edition with the headline: Amassing Power in South Africa as Corruption Rots Its Schools. Order Reprints | Today’s Paper | Subscribe