On Wednesday, South Africans will go to the polls in the country's second all-race election to choose their next president. Nelson Mandela--who, at 80, is not running for reelection--will then bid farewell to the nation that he has both led and enthralled for the past five years. He will likely pass the torch to Deputy President Thabo Mbeki, the leader of the African National Congress. But Mbeki faces a rough road as he tries to placate an impatient black majority that still struggles to gain an equal footing.

In his five years as president, Mandela's achievements have been breathtaking. He inspired, cajoled and browbeat his compatriots through a peaceful transition to democracy and made racial reconciliation the focus of his tenure. In the process, South Africa taught a skeptical world a lesson about how former antagonists can bridge the racial divide.

But the challenges Mandela leaves behind are equally daunting. In my travels as a journalist in South Africa over the last 15 years, I have been continually struck by the grinding poverty that has been the greatest legacy of apartheid--the system of racial separation and domination imposed by the white National Party when it came to power in 1948--which lasted until 1994.

Now, after Mandela, South Africa faces a new acid test: Can it bridge the yawning economic divide that continues to cleave the country? Mbeki has campaigned on a slogan of "a better life for all," a promise made more difficult by a stagnant economy and the effects of globalization, which have resulted in the loss of a half-million jobs since 1994. His success or failure to keep that pledge will determine whether the "Mandela miracle" was merely a shooting star that briefly illuminated the way for a nation awakening from a long nightmare, or the start of a lasting renaissance for one of Africa's wealthiest nations.

South Africa after apartheid feels like a nation that has breathed a collective sigh of relief. Gone is the reflexively defensive posture of whites and the head-hanging despair of blacks that I routinely encountered in the dark days of the 1980s. Blacks are finally free to enjoy the privileges of normal life: going about daily tasks unmolested, traveling where they like and, for some, acquiring a bit of wealth. Even in poor communities, there are glimmers of hope.

Mandela frequently and proudly itemizes the social progress achieved in the wake of apartheid: His government provided basic water supply to 3 million people, telephone service to 1.5 million homes, and electricity to 2 million households. In addition, 550 primary health care clinics have been built, and more than 1,500 schools have been renovated.

On recent visits, I found evidence of renewal even in remote villages. Among the thatched huts of Matatiele in the lush hills of KwaZulu-Natal Province, I watched children filling water jugs for an older woman using a new hand pump provided by the government. This seemingly humble innovation saves the villagers hours of backbreaking effort to fetch water from a distant stream. Electricity also has finally reached the village.

But these heartwarming images belie a vexing reality: Apartheid lives on in South Africa. It continues in the chance encounter of a former activist and the man who tortured her--a cop on the "new" South African police force. It lives on in the squatter camps that swell like the sea, lapping ever closer to the heart of the cosmopolitan cities. And, most of all, it endures in the profound contradictions between white wealth and black poverty.

For many South Africans, there has been a revolution without change. Blacks have assumed top leadership roles in government and some businesses. But these new leaders have been reluctant to bring about any dramatic economic transformation that would broaden opportunities for the poor.

Adelaide Buso captures the contradictions of the new South Africa. She is a domestic worker who lives in a squatter shack near Cape Town with her three grown sons. She is also a new municipal councilor for the area south of the city, making policy for some of the wealthiest communities in the country--the same households where she cleans floors and toilets. She has finally attained political power. But she is still poor. "We going to bury the whole book of apartheid," Buso tells me emphatically over the din of the squall that raps on the roof of her shanty. Only then, she says, will South Africa truly be "the rainbow nation."

I have been eager to measure progress in the new South Africa in places that were symbols of oppression from the old days. So I went to Khayelitsha ("our new home"), in the shadow of Cape Town, which some guidebooks describe as "the most beautiful city in the world." When I last saw it in 1984, Khayelitsha was a sandy wasteland where the white government was planning to dump thousands of black families, who unsuccessfully fought the forced relocation. When I recently returned, I found a slum that sprawled to the horizon and far greater poverty than before. The original Spartan metal houses were surrounded by miles and miles of shacks. Estimates of Khayelitsha's current population range from 500,000 to 3 million. What was once the warped geography of apartheid and viewed as an aberration is now simply the natural landscape.

As I contemplate South Africa after Mandela, Khayelitsha epitomizes one of my fears: after the initial outpouring of energy to redress the problems created by apartheid, compassion fatigue will set in. The black nouveau riche will become comfortable with their privilege and grow tired of dealing with the seemingly intractable problems of the poor. It's not that change isn't slowly percolating through the squatter camps. The running water, electricity, decent education and even permanent homes that people now have are easing hardship. But measured against the people's enormous needs and their wild expectations of how life would change once apartheid fell, it sometimes feels as if Mandela's government has done almost nothing. It has succeeded in building about two-thirds of the 1 million new homes it had promised to build by 1999--but most of them are tiny structures that have become the nucleus of new slums. Mandela also promised during the '94 campaign to redistribute 30 percent of South Africa's rich farmland to black farmers; in the face of the agonizingly slow progress of land reform, the government has quietly abandoned that pledge.

While Mandela, regarded as a saint, is considered above blame for his government's failure to deliver on its promises, Mbeki, a mere politician, will be given no such leeway.

South Africa's effort to confront and expose its dark past has been one of the triumphs of the Mandela years. The Truth and Reconciliation Commission was established in late 1995 to investigate abuses of the apartheid era and to consider granting amnesty to perpetrators who confessed. When I first began attending hearings of the commission, I was sharply critical of the notion that killers could trade truth for amnesty. But after a year of witnessing this extraordinary process of national confession, I changed my mind. South Africa has gained far more than it lost by pardoning its demons. The truth has proved a potent antidote to revenge.

It is remarkable that South Africa has not boiled over into open warfare, given the deep fault lines that continue to rend the society. But the absence of war should not be mistaken for true reconciliation, which may simply be too much to ask at this early juncture. "Reconciliation" implies a sense of reciprocity and mutual acknowledgment of wrongdoing between former antagonists that does not exist in South Africa. "Peaceful coexistence" more accurately describes the fragile post-apartheid truce.

Such coexistence cannot be taken for granted. The peace that has reigned in South Africa took root under the persistent prodding of Mandela and Archbishop Desmond Tutu, who made forgiveness a matter of patriotic duty. As those moral beacons pass from the scene, old animosities may yet resurface, particularly in places where little change has occurred. As Truth Commissioner Mary Burton told me, "It's not good enough telling people to reconcile when they are still as poor and disadvantaged as they've been in the past."

The gulf between hope and reality, between the haves and the have-nots, is the fuse awaiting a spark in South Africa. President-in-waiting Mbeki knows this, and he is also aware that he will not enjoy a long honeymoon in his new job. Mbeki warned a year ago that the government's failure to deliver on its promises was "producing rage among millions of people"; he hinted darkly that the country could "explode."

But absent a strong hand from the government, whites have shown no appetite for willingly doling out the spoils of the apartheid plunder. And despite Mbeki's bluster, the ANC government has done little to rebalance the skewed scales of wealth. Its conservative economic policies have pleased the World Bank and the IMF, but infuriated township activists, who feel betrayed by the slow pace of change. "Apartheid is not like a dirty shirt that you can just take off and replace with a clean shirt," reflected Father Michael Lapsley.

He would know. Once an exiled ANC member, he lost his hands and an eye in 1990 in a parcel bomb attack that was the work of apartheid-era security forces. Sitting at home in Cape Town, with his steel hooks crossed in his lap, Lapsley mused, "It'll take a hundred years to heal from the wounds of apartheid."

I place my hopes for change with the young generation: the first South Africans who will grow up in something resembling a humane, multiracial, democratic society. That promise was evident when I visited the District Six Museum in Cape Town, a living memorial to a multiracial community that was bulldozed in the 1960s. A group of black schoolchildren was touring when a member of the museum's staff held up a "Whites Only" sign, a ubiquitous fixture of the apartheid years. "Does anyone know what this is?" she asked.

There was silence and embarrassed giggles. Finally, a 10-year-old boy raised his hand. "I saw a picture of it in a book once. But I'm not too sure what it means," he said.

That may be South Africa's greatest achievement.

David Goodman is the author of the just-published "Fault Lines: Journeys Into the New South Africa" (University of California Press).