When, after 27 years, Nelson Mandela was finally released from prison, the world marveled at his generous spirit, even temperament, genteel manners, disarming wit, ready smile and lack of bitterness.

Admirable as they were, those saintly virtues don't begin to explain his political genius. Mandela was also cunning, iron-willed, bullheaded, contemptuous — and more embittered than he let on. He needed all of his traits — soft and hard — to engineer a political miracle: persuading a sitting government to negotiate its own abdication by yielding power to the very people it had ruthlessly oppressed.

Historic transfers of that magnitude typically occur only at gunpoint. To pull it off peacefully, Mandela, who died Thursday, knew that he had to tame the racial fears and hatreds that have haunted beautiful South Africa since the first whites settled there four centuries ago. He needed to teach militant blacks that they couldn't take revenge and frightened whites that they shouldn't fear retribution.