THE FOUNDER and first president of the South African democracy has died after a long illness and an even longer battle for the soul of one of the most repressive regimes in world history.

The Madiba, as he was affectionately known, was 95. He had spent his entire adult life fighting for a people who had been denied even the most basic rights and, later, transforming a bastion of white privilege into Africa's leading democracy.

As we remember the good of his work and life, it's important to also remember the bad into which he was born. In 1918, he was born in a nation where people who looked like him were often beaten in the streets like pack animals for being in a city after dark, where a ruling white minority declared itself a republic, then systematically subjugated and dehumanized the vast majority of the indigenous population.

He spent two years in exile, months on the run and 27 years in prison for his efforts. But that long, tortuous gestation period ended with the birth of a nation.

It is impossible to assess Mandela's legacy without understanding what a cesspool of injustice and racism South Africa had been. Before the Mandela era, the so-called Republic of South Africa had virtually enslaved more than 20 million blacks and disenfranchised everyone else who could not prove they were white. Apartheid finished the business begun by the founders of the Union of South Africa in 1910. The constitution had merely relegated blacks to third-class citizenship. Under apartheid, blacks were denied the right to even call themselves South Africans.

The Natives Land Act of 1913 prohibited blacks from owning or even renting land outside of the "Bantustans," where blacks were herded. The Natives Urban Areas Act of 1923 divided the nation into rural and urban enclaves, relegated blacks to rural areas only and prohibited their movement from rural to urban, except for work. The Representation of Blacks Act of 1936 ended the right of blacks to run for office or to vote for any white candidate.

Mixed marriages were outlawed in 1949 and the Population Registration Act of 1950 divided the nation into three racial classifications, and required everyone to be identified by race as a prelude to the Group Areas Act of 1950, which created residential areas for each race and enforced it with the involuntary resettlement of millions of people from what had been their homes. By 1952, the government had forced blacks to carry passports in the land of their birth.

1942 marked what the South African government called the radicalization of the anti-apartheid movement. It was the year that Mandela abandoned a life of privilege as the educated ward of a respected chief and joined the fight to free his people. He became a leader of the outlawed African National Congress and, for 20 years, he directed their campaign of nonviolent defiance. Mandela ultimately became the international symbol of the war against entrenched racism. He had to be stopped. In 1964, he was sentenced to life in prison.

Before the Mandela era, South Africa was a renegade nation, isolated from the international community, with an economy based on the exploitation of cheap labor, teetering on the brink of collapse and ruled by a regime that would rather go down with the ship of state than share power with the majority of its people.

But its salvation was locked in a dungeon on Robben Island. They had offered Mandela his freedom years earlier in return for his silence. He refused. He could not be free if his people were not. With the unjustly imprisoned Mandela as its rallying point, a world community agitated for an end to apartheid, until the system finally fell under the weight of the massive injustice it was upholding. His release from prison ended what he would call a long walk to freedom for himself and an entire nation.

"I place the remaining years of my life in your hands," a 72-year-old Mandela told his people as he emerged from captivity and resumed the yoke of leadership. In five years as president, he forged a ruling coalition that brought together dozens of factions that had been at war with each other for generations. He sold his people on a policy of reconciliation rather than revenge. Then, unlike the liberators who had freed other African nations from European exploitation, he stepped aside, embracing the succession that will allow South Africa's democracy to endure.

He hated racism with a passion. That passion fueled his drive to free his people.

But, even more remarkably, it wouldn't let him deny the rights of citizenship even to the very racists who had made him a man without a country in the land of his birth.

Nelson Mandela leaves behind to mourn his wife of 14 years, Graca Machel; three children; 17 grandchildren and many great-grandchildren; and freedom-loving people all over the world.