Now we look at the life of the man who transformed himself, while behind bars and you spoke to a young jailer that became mandela's trusted friend behind bars. This was an incredible tale, the jailer... See More
Now we look at the life of the man who transformed himself, while behind bars and you spoke to a young jailer that became mandela's trusted friend behind bars. This was an incredible tale, the jailer warned he would guard south africa's most dangerous criminal but they would form a secret code. Reporter: Here in america, mount rushmore honors the fathers of our democracy. In south africa, there would be one face. Nelson mandela, a hero to millions whose devotion to the cause of freedom transformed south africa. Mandela was an immensely charismatic figure. Tall, handsome, extroverted, had this fantastic smile, a smile that just lit up whatever room he went into. Reporter: But for 27 years, he spent most of his days a prisoner in this room. And it was there he would meet a young country boy, who started out mandela's enemy, but forged the least likely friendship in history. A prison guard named christo brand, who remembers took us to a hill overlooking robben island remembering what they warned him. That guard was just 18-year-old when he met his 60-year-old prisoner. When that jailer met mandela, he met an elder, who would treat the young white man with respect. And cristo would slowly offer the same in return. And that jailer told us of one of winnie mandela's visits, and her request she be allowed to show nelson mandela his brand new grand baby. She said can I please show nelson from a distance. Reporter: The jailer telling winnie, no children allowed. What she didn't know was while she waited in a holding area the jailer brought the baby to mandela. Tears were coming out of his eyes. Reporter: Nobody knew. Nobody knew. Reporter: There would be many secrets between the jailer and his friend and the secret code I would show him this, and i would just start showing him this. Mandela immediately know I'm bugged. I was bugged a lot of times. Reporter: You lied to keep your job and to keep your friendship with mandela. That's correct. Reporter: During all of those isolating years on robben island, the prison guard said there was one view from the prison courtyard of the country nelson mandela loved, and that was the very top of table mountain, here in cape town behind me. That mandela would look to this view, wondering if he'd ever be free. But for mandela, his own freedom was always less important than that of the people of south africa, even as a young man. For if life is a series of choices, nelson mandela never took the easy ones. He was born into african royalty -- the son of a chief, but chose to become a lawyer for the poor. I think not until he got to johannesburg where he felt the effects of prejudice for the first time, where -- where he felt, "my god, you're treating me like this." Reporter: His practice, the first black-run law firm in south africa, was flourishing, but he could not stay neutral against apartheid. A system that made blacks second class citizens, separate housing and schools. Crushing poverty. For more than three centuries we have lived at the most brutal system of racial oppression. Reporter: Mandela found his calling in the fight against apartheid. A south africa, where the white minority ruled a population that was nearly 90% black. And created divisions, committed untold massacres of innocent people because they wanted to be treated with dignity. His party, the african national congress, was committed to non violent resistance. But many of his own supporters would often ask why so many of their own paying the price. There are many people who feel that it is useless and futile for us to continue talking peace and non-violence against a government whose only reply is only savage attacks on an unarmed and defenseless people. Reporter: Peaceful resistance -- until the sharpeville massacre in 1960, when white police shot 69 unarmed protestors. The government branding the charismatic leader a terrorist. Mandela went underground. We have made it very clear in our policy that south africa is a country of many races. There is room for all the various races in this country. Reporter: By 1962 mandela's fight against apartheid landed him on trial for treason. He could have cooperated but instead, at trial, he gave a rallying speech heard around the world, captured by chance on a dictaphone. I have cherished the ideal of a democratic and free society. It is an ideal for which I hope to live for and to see realized. But my lord, if it needs be, it is an ideal for which I am prepared to die. Reporter: The power and defiance and eloquence of that statement really electrified the nation, electrified black south africa, electrified the world. Reporter: Sentenced to life in prison, mandela spent most of his 27 years behind bars in that cell on robben island. Assigned to work in the quarry, shoveling rocks, raking stones, work many believe led to those weakened lungs. And to that suffering even in the end. The conditions were brutal. People were assaulted regularly. People were -- deprived of meals for two or three times a day. Prison was this great crucible that taught him self-control. Because you had to have it. Reporter: Mandela would study for years in the tiny prison library -- quietly asking that most unlikely friend, the jailor, to help teach him the language of the whites in power --afrikaans. He would write essays and there was a reason for this -- mandela famously said, "if you talk to a man in a language he understands that goes to his head. If you talk to him in his language, that goes to his heart." That's what he did. And that what he would strive for and that's what he was loved for and that's what he would fight for while he was in prison, to have people live in peace. To spend 27 years at the prime of your life is a tragedy. And I regret, you know, those years that I have wasted in prison. But, I also had the opportunity of reading very widely, and especially biographies, and i could see what men, sometimes from very humble beginnings, were able to lift themselves with their bootstrings. Reporter: And there was something else he did while on robben island. We were given rare access to this tiny archive room in johannesburg where they have spent years pouring through the tender letters mandela wrote to his family, to his children while in prison. He walked out with it when he left prison, so he took it with him. Reporter: In that cell, lined with books, and the photograph of winnie -- the notebooks with first drafts of every letter. Every word carefully chosen because in the beginning he was allowed just one letter every six months. So he needed to know exactly what he wrote, so he doesn't waste space. Reporter: He wrote to his children about his dream of one day seeing them again. "I do not know, my darlings, when I will return. I told you that the white judge had said I should stay in jail for the rest of my life. It may be long before I come back. It may be soon. Nobody knows it's his name, nelson mandela, and then his prison number, 466/64. Reporter: When we come back, nelson mandela is freed after 27 years. The lines that led to history. And years later, michelle obama's visit to south africa as first lady, in that room with
This transcript has been automatically generated and may not be 100% accurate.