Twenty-seven years in captivity.

That will destroy you, as they hope, or it will make you stronger than they can ever understand. When your strength becomes wholly moral, when it needs no force of arms, when it is personal and singular, the gates open. Mandela, who has left us finally at the age of 95, smashed the gates down.

His name was not Nelson. That was the first lesson learned. A white world thought it could eradicate a person at will. In the 1920s, it could take a prince, real name Rolihlahla, and expunge his identity. They did that to the child on his first day in school. They did not grasp that their power was lethal to itself. Whites gave him the name they would never forget.

A prince, but also a farm boy, a peasant. That too was unforeseen. ­Ferociously literate, but the child of unlettered parents. A devotee of justice in a world that refused to heed his right to justice. They put him away for 27 years - on Robben Island, at Pollsmoor, in the Victor Verster jail - but they could not still a challenge made flesh. His life was his purest testimony.

Mandela shaped many of us. When Margaret Thatcher called his African National Congress a "typical terrorist organisation", we knew where we stood. When some miserable British bank preferred apartheid money to decency, we understood the world better. When they damned him for a communist, we wondered what they really hated. Our juvenile "struggle" was little enough, mere gestures, but an education beyond price.

The gestures mattered; in the end, they mattered a great deal. Speaking for himself and his fellow prisoners, Mandela would remember that in 1981, standing against a tide of official British complacency and contempt, Glasgow took the first step and "declared us to be free".

The freedom of one city was followed by others across Scotland, across Britain, and across the world. When Michael Kelly, then Lord Provost of Glasgow, launched a declaration for Mandela's release, 2500 civic leaders in 56 countries signed up. Glasgow's cry for freedom became one note in a shout heard everywhere. And apartheid's walls began to crumble.

It is hard to remember, far less to convey, why getting Mandela out mattered. In one way, it was as naive as the little badge that lies in a drawer. What regime was ever brought down by a badge or a boycott? Why would one man's liberation change anything? Hatred and injustice did not end, after all, when his long walk was done.

You could be sharper still. There are 4.66 million South Africans out of work, most of them black. Among the under-35s, 70% are jobless. Scandals have consumed the ANC and stalked President Jacob Zuma. Travesties of justice, crime, corruption and bizarre attitudes to HIV, attitudes against which Mandela campaigned so hard, have tainted the legacy.

Social justice has not marched with political freedom. White wages still vastly outstrip the earnings of blacks. In a free country, protesting miners have faced police guns. At Marikana last year 34 were massacred. Some, nursing disillusionment, prefer to say that Mandela's moral purpose was clearer when he had no freedom.

Part of that would be true, none of it would be just. Overlooked is another truth. Most of us who grew up with the fact of apartheid never truly expected to see its end. This country was complicit, the Americans didn't care, and neighbouring nations were powerless. Mandela, shut up in those cells, was the power in the darkness.

What he taught us had little to do with ideology. We didn't have to be trained, most of the time, to understand that apartheid was a crime against humanity. His example relied upon the relentless force of conviction. The man they kept caged year after year could make you ashamed of yourself. In time, he shamed the world.

He said it all before they locked him away in Rivonia on April 20, 1964. "During my lifetime," Mandela said, "I have dedicated myself to the struggle of the African people. I have fought against white domination and I have fought against black domination. I have cherished the ideal of a democratic and free society in which all persons live together in harmony and with equal opportunities. It is an ideal which I hope to live for and achieve. But if needs be, it is an ideal for which I am prepared to die."

A revolutionary: let it not be forgotten. Nelson Mandela was a Marxist first to last. The world's celebrities, lining up for their photo-opportunities, did not care to be reminded. In America, they preferred a hero wreathed in civil rights idealism. They adored - who did not? - the fatherly figure who placed apartheid beneath humanity's contempt. For all the applause, the United States kept Mandela on its terrorist watch list until 2008.

His was a political intelligence founded on a set of propositions. Mandela would choose his words to suit his audience, but the old word, "comrade", stuck to his lips. He was with the people and of the people.

The apartheid regime understood that much. Its enemy was a Marxist revolutionary who did not falter in his allegiance.

As such, he never made the error of confusing himself with the movement. That was Oliver Tambo's brilliant notion. Getting Mandela out became the ANC's symbol for everything, but not the answer to every question. He knew it, too, and did white South Africa an immense, unearned courtesy by voicing not a word of bitterness towards those who had used racism as a weapon.

His name was not Nelson. Now few people on the planet do not know the name. Those years in prison were supposed to remove him from the world's consciousness. Who is there now who doesn't know of the man and what he did? Mandela caused apartheid to destroy itself. It died because of sanctions. It died because whites could not stand to live as pariahs. But mostly it died of shame.

His country will have to learn to live without him. Ugly as the sentiment might sound, Mandela was too dominant for too long, too large, too imposing. Perhaps the rest of us also need to be parted from the belief that one man's moral force is compensation for our failures. He didn't walk out of jail so that we could go on imprisoning ourselves.

Can a nation have a father? Probably not, though South Africans struggle to think of Madiba in any other way. Belief has a certain paternity, nevertheless, and integrity is liable to breed many children. Mandela's gift to South Africa is bound up in words like truth and reconciliation. It is a long way from secure, but the old man made one guarantee. There is no going back.

It is impossible now to imagine anyone founding a society in which a child can be renamed on a whim, or treated as inferior in law, without facing universal revulsion. When Mandela was imprisoned, beliefs we take for granted were still contested. South Africa's first democratically elected president altered humanity. Alongside that truth, oratory and mourning do not count for much.

Twenty-seven years in captivity can break a human being. Such is the intention. Barbarism can also make a man of rare quality. We are lucky to have seen this Rolihlahla.