KHAYELITSHA, South Africa -- The road in front of Princess Rini's leaky, wooden shack has been paved. There is a primary school and a library down the street. And though three of the outdoor taps the government built nearby are broken, a twist on the fourth brings forth copious clean water.

"It's changing, a little bit, a little bit," said Rini, 38, a widow with short, braided hair who moved to Khayelitsha, among Cape Town's poorest and most dangerous townships, a decade before apartheid ended in 1994. "It's better than before."

The reason: "It's Thabo Mbeki," she said.

Inequality remains extreme in South Africa, with sharp divisions along lines of race and class. But Mbeki, who could become a lame-duck president as soon as December, when the ruling African National Congress has elections for party leader, has already crafted a legacy of fiscal stability and modest racial progress that, advisers say, he is working furiously to protect as rivals vie to replace him.

Mbeki is seeking to maintain control by competing for a third term as party leader, a move that would help him handpick the next president. But analysts say the outcome is far from certain in a year they call the most politically tumultuous since apartheid.

In these battles, the slow pace of change is perhaps Mbeki's most glaring weakness. Rush hour in Cape Town, southern Africa's original European colony and still a bastion of white privilege, is swollen with luxury cars speeding past dilapidated townships. Executive suites in downtown skyscrapers remain dominated by the small white minority.

"We have not succeeded at de-racializing the economy," said Willie Esterhuyse, a retired Afrikaner philosophy professor who became a friend and adviser to Mbeki. "After liberation, nothing changed. . . . The racism is embedded in the physical nature of the country."

Although the racial order has proved dauntingly resilient, a strong economy has provided benefits to all levels of society.

Rini said she could not imagine ever living in the lush white neighborhood where she works one day a week, earning $57 for the month, and she craves steadier employment and a concrete home with plumbing. But she said she is grateful for the improvements to her neighborhood and for the $27 monthly government grant she receives to help support her youngest child.

Of Mbeki's government, she said its programs were "better than nothing."

Mbeki's advisers acknowledge that his cerebral approach to the presidency will never generate the enthusiasm many South Africans felt for Nelson Mandela, the charismatic first president of the post-apartheid era. But Mbeki, who was deputy president during those years, was the intellectual force behind policies that have allowed the country to become fiscally sound while gradually providing homes, water, electrical connections and grants to millions of the poorest South Africans.

Esterhuyse, who was an emissary for the apartheid government when he first met Mbeki in the late 1980s, said that even then Mbeki was "the guy in the engine room" capable of bringing ANC ideals to reality.

He became president in 1999, for the first of two five-year terms allowed by the constitution, but soon was embroiled in controversy when he questioned the scientific consensus on the cause of AIDS and, in the opinion of activists and many global leaders, moved too slowly on providing antiretroviral drugs. His international standing, analysts say, never entirely recovered.

In South Africa, he has developed a reputation as ruthless in backroom dealings, brittle in the face of criticism and emotionally remote in public appearances. His anti-populist instincts have become so hardened that even when he agrees to the demands of critics, as he eventually has on such sensitive matters as AIDS and South Africa's rampant violent crime, he has refrained from crowd-pleasing gestures of empathy for victims.

In a speech to Parliament this month, Mbeki said tartly, "There will be no empty theatrical gestures, no prancing on the stage and no flagellation, but we will continue to act against crime, as decisively as we have sought to do throughout the years of our liberation."

By contrast, he has consistently displayed passion for redressing the enduring racial divide, a subject he often calls the "national question." But on that goal, advancement is least clear.

Government programs requiring businesses to diversify their ownership have turned a small number of politically connected men and women into millionaires. And the number of blacks in top management jobs has increased from 13 percent in Mbeki's first full year in office to 27 percent, according to government statistics.

But unemployment among blacks tops 30 percent, and in many townships more than half of adults lack work.

Equally daunting is the legacy of Bantu education, which during apartheid sought to keep blacks as second-class citizens trained mainly for menial jobs. The 2001 census found that nearly half of black South Africans have no formal education or left school at the primary level.

"There's been a lack of creativity in how do you deal with poverty, how do you deal with unemployment," said William Gumede, author of "Thabo Mbeki and the Battle for the Soul of the ANC," speaking from London, where he is studying. "The remaining underclass is really going nowhere."

Property values have risen sharply for white South Africans, and the Johannesburg Stock Exchange regularly reaches new highs. South African companies have moved aggressively to other African countries, Asia and beyond.

Yet even as government receipts soar, South Africa's schools remain understaffed, and many of its public hospitals and clinics are overwhelmed.

Mbeki's approach to such woes is inherently cautious, based on his belief that major changes are possible only if the economy is made strong, his advisers said.

That response has not satisfied many ANC activists, and several of the candidates seeking to replace Mbeki -- including his fired former deputy Jacob Zuma -- draw support from those demanding more generous jobs programs, protection from overseas competition or other initiatives that might quickly improve the lives of the poor.

The most dramatic changes under Mbeki, however, are found not among the poor or the rich, but among the burgeoning black middle class, which increasingly has access to shopping, housing and jobs that long were the exclusive preserve of whites.

The impact of these new consumers has surprised even businesses, which have struggled to keep up with demand for electricity, gasoline and consumer goods, said Joel Netshitenzhe, Mbeki's top policy adviser, speaking in Pretoria.

"If there's a real tsunami in South Africa, that's it," he said. "Demand is growing so fast that businesses can't cope."

Solomzi Yapi, 41, who one recent day was hiking up a steep, sandy hill here in hopes of shrinking the belly that grew with his own prosperity, said he sees the economic changes as he drives his Volvo sedan through black townships, selling life insurance. Each passing year, he said, brings more customers with the means to buy his policies -- a change he attributes to Mbeki.

"He does not care how people perceive him," Yapi said. "He's a good administrator."

Yet breaking down racial barriers has come more slowly than Yapi expected when apartheid ended.

"I thought everything was going to be a very sharp turn . . . that we were going to have mixed much more than we've mixed now," he said. "Back then, I was naive. I didn't know anything about politics. We knew a lot about apartheid, not governance."

But a visit to a McDonald's restaurant three years ago convinced him change was coming, he said. All of the managers and the other customers were white. Everyone cooking or working the cash registers was black. But as he ordered his food and ate it, the service was courteous and his visit there caused no stir -- something unimaginable under apartheid.

It amounted to progress, he said, in South Africa.