Nelson Mandela has died at the age of 95.

The anti-apartheid leader died Thursday at home in Johannesburg.

Mandela spent three months in a Pretoria hospital after being admitted in June for a recurring lung infection. He was discharged in September and has been receiving medical care at home ever since.

Mandela spent 27 years in jail for fighting racist white rule. He became South Africa's first black president in 1994, and served one five-year term. He later retired to Qunu, a village in South Africa's Eastern Cape Province.

In 1998, he became the first foreigner to receive an honourary Companion of the Order of Canada. He became an honorary Canadian citizen in 2001.

More from The Associated Press below

Nelson Mandela, who became one of the world's most beloved statesmen and a colossus of the 20th century when he emerged from 27 years in prison to negotiate an end to white minority rule in South Africa, has died. He was 95.

South African President Jacob Zuma made the announcement at a news conference late Thursday, saying "we've lost our greatest son.''

His death closed the final chapter in South Africa's struggle to cast off apartheid, leaving the world with indelible memories of a man of astonishing grace and good humour. Rock concerts celebrated his birthday. Hollywood stars glorified him on screen. And his regal bearing, greying hair and raspy voice made him instantly recognizable across the globe.

As South Africa's first black president, the ex-boxer, lawyer and prisoner No. 46664 paved the way to racial reconciliation with well-chosen gestures of forgiveness. He lunched with the prosecutor who sent him to jail, sang the apartheid-era Afrikaans anthem at his inauguration, and travelled hundreds of miles to have tea with the widow of Hendrik Verwoerd, the prime minister at the time he was imprisoned.

Story continues below slideshow

Loading Slideshow...
  • NEXT: Canadian Politicians React To Mandela's Death

His most memorable gesture came when he strode onto the field before the 1995 Rugby World Cup final in Johannesburg. When he came on the field in South African colours to congratulate the victorious South African team, he brought the overwhelmingly white crowd of 63,000 to its feet, chanting "Nelson! Nelson! Nelson!''

For he had marched headlong into a bastion of white Afrikanerdom -- the temple of South African rugby -- and made its followers feel they belonged in the new South Africa.

At the same time, Mandela was himself uneasy with the idea of being an icon and he did not escape criticism as an individual and a politician, though much of it was muted by his status as a unassailable symbol of decency and principle. As president, he failed to craft a lasting formula for overcoming South Africa's biggest post-apartheid problems, including one of the world's widest gaps between rich and poor. In his writings, he pondered the heavy cost to his family of his decision to devote himself to the struggle against apartheid.

He had been convicted of treason and sentenced to life imprisonment in 1964 for leading a campaign of sabotage against the government, and sent to the notorious Robben Island prison. It was forbidden to quote him or publish his photo, yet he and other jailed members of his banned African National Congress were able to smuggle out messages of guidance to the anti-apartheid crusade.

As time passed -- the "long, lonely, wasted years,'' as he termed them -- international awareness of apartheid grew more acute. By the time Mandela turned 70 he was the world's most famous political prisoner. Such were his mental reserves, though, that he turned down conditional offers of freedom from his apartheid jailers and even found a way to benefit from confinement.

Story continues below slideshow

Loading Slideshow...
  • OTTAWA, CANADA: Nelson Mandela greets people as he walks with Prime Minister Brian Mulroney on his arrival in Ottawa on June 17, 1990 for a three-day visit to Canada.

  • OTTAWA, CANADA: Nelson Mandela walks with Prime Minister Brian Mulroney on his arrival in Ottawa, on June 17, 1990 for a three-day visit to Canada.

  • South African anti-apartheid leader and African National Congress (ANC) member Nelson Mandela arrives in Ottawa, Canada, for an official visit on June 17, 1990.

  • South African anti-apartheid leader and African National Congress (ANC) member Nelson Mandela arrives in Ottawa, Canada, for an official visit on June 17, 1990.

  • OTTAWA, CANADA: A Royal Canadian Mounted Police officer helps South African President Nelson Mandela (C) off a carriage on Sept. 23 during a welcoming ceremony at Rideau Hall in Ottawa, Canada.

  • OTTAWA, CANADA: South Africa President Nelson Mandela (C) reviews the Canadian military guard of honour on Sept. 23 during a welcoming ceremony at Rideau Hall in Ottawa, Canada. Mandela is on a three-day state visit to Canada.

  • OTTAWA, CANADA: South Africa President Nelson Mandela (L front) and his wife Graca Machel (R front) wave to the crowd during a welcoming ceremony at Rideau Hall in Ottawa, Canada, on Sept. 23.

  • OTTAWA, CANADA: South African President Nelson Mandela kisses Lekgetho Makena, a local resident, on the hand during a welcoming ceremony at Rideau Hall in Ottawa, Canada on Sept. 23. Mandela and his wife Graca Machel (background) are on a three-day state visit to Canada.

  • OTTAWA, CANADA: South African President Nelson Mandela acknowledges a standing ovation in the House of Commons on Parliament Hill in Ottawa on Sept. 24, 1998. The president received the ovation on his arrival in the House by all members of Parliament, including Trade Minister Sergio Marchi (top left) Diane Marleau, (centre) International Cooperation Minister and Prime Minister Jean Chretien (right).

  • OTTAWA, CANADA: South African President Nelson Mandela addresses the Canadian Parliament on Sept. 24, 1998 in the House of Commons in Ottawa, Canada. Mandela is on a three-day state visit to Canada.

  • OTTAWA, CANADA: South African President Nelson Mandela smiles after receiving an honorary Investiture into the Order of Canada at a ceremony in Ottawa on Sept. 24, 1998. It is the first time a foreign Head of State has received the award.

  • OTTAWA, CANADA: South African President Nelson Mandela is congratulated by Governor General Romeo LeBlanc and applauded by Prime Minister Jean Chretien after receiving an honorary Investiture into the Order of Canada at a ceremony in Ottawa on Sept. 24, 1998. It is the first time a foreign head of state has received the award.

  • TORONTO, CANADA: Canadians show their poster of South African President Nelson Mandela at the the Toronto's SkyDome on Sept. 25, 1998 where Mandela launched the 'Canadian Friends of the Nelson Mandela Children's Fund.' Canadian Prime Minister Jean Chretien also attended.

  • TORONTO, CANADA: South African President Nelson Mandela addresses some 40,000 youths at the the Toronto's SkyDome launching 'Canadian Friends of the Nelson Mandela Children's Fund' on Sept. 25, 1998 in Toronto. Canadian Prime Minister Jean Chretien also attended.

  • TORONTO, CANADA: South African President Nelson Mandela (C) embraces two of the 40,000 youths who attended the 'Canadian Friends of the Nelson Mandela Children's Fund' launching ceremony at the Toronto SkyDome on Sept. 25, 1998.

  • HULL, CANADA: Former South African president Nelson Mandela and Prime Minister Jean Chretien are flanked by RCMP constables in Hull, Quebec, as they pose for photographs across the river from the Parliament Buildings. Mandela was presented with an honorary Canadian Citizenship on Monday November 19, 2001.

  • HULL, CANADA: Former South African President Nelson Mandela (R) waves to well wishers with Canadian Prime Minister Jean Chretien (L) on Nov. 19, 2001 after receiving his honorary Canadian Citizenship at a ceremony in Hull, Quebec just outside Ottawa. The distinction has been awarded only once before -- posthumously to Swedish diplomat Raoul Wallenberg, for saving the lives of some 100,000 Jews during World War II. This is the third visit to Canada for Mandela, recipient of the Nobel Peace Prize in 1993.

  • HULL, CANADA: Canadian Prime Minister Jean Chretien (R) and former South African President Nelson Mandela (L) wave on Nov. 19, 2001 as they arrive at a ceremony in Hull, Quebec. Mandela received an honorary Canadian Citizenship. The only other recipient of an honorary Canadian citizenship was the late Swedish diplomat Raoul Wallenberg. That award, for Wallenberg's work to save Hungarian Jews from Nazi concentration camps during World War II, was granted posthumously in 1985.

  • HULL, CANADA: Canadian Prime Minister Jean Chretien (C) shakes hands with Former South African President Nelson Mandela (R) on Nov. 19, 2001 after Mandela received his honorary Canadian Citizenship at a ceremony in Hull, Quebec. Graca Machel (L), wife of Mandela, looks on.

  • HULL, CANADA: Former South African President Nelson Mandela (R) waves to well wishers with Canadian Prime Minister Jean Chretien (L) on Nov. 19, 2001 at a ceremony honouring him as a Canadian Citizen in Hull, Quebec. The only other recipient of an honorary Canadian citizenship was the late Swedish diplomat Raoul Wallenberg. That award, for Wallenberg's work to save Hungarian Jews from Nazi concentration camps during World War II, was granted posthumously in 1985.

  • HULL, CANADA: Former South African President Nelson Mandela smiles as he receives his honorary Canadian Citizenship in Hull, Quebec on Nov. 19, 2001. The only other recipient of an honorary Canadian citizenship was the late Swedish diplomat Raoul Wallenberg. That award, for Wallenberg's work to save Hungarian Jews from Nazi concentration camps during World War II, was granted posthumously in 1985.

  • NEXT: Canadian politicians react to Mandela's death

"People tend to measure themselves by external accomplishments, but jail allows a person to focus on internal ones; such as honesty, sincerity, simplicity, humility, generosity and an absence of variety,'' Mandela says in one of the many quotations displayed at the Apartheid Museum in Johannesburg. "You learn to look into yourself.''

Thousands died, were tortured and were imprisoned in the decades-long struggle against apartheid, so that when Mandela emerged from prison in 1990, smiling and waving to the crowds, the image became an international icon of freedom to rival the fall of the Berlin Wall.

South Africa's white rulers had portrayed Mandela as the spearhead of a communist revolution and insisted that black majority rule would usher in the chaos and bloodshed that had beset many other African countries as they shook off colonial rule.

Yet since apartheid ended, South Africa has held four parliamentary elections and elected three presidents, always peacefully, setting an example on a continent where democracy is still new and fragile. Its democracy has flaws, and the African National Congress has struggled to deliver on promises. It is a front runner ahead of 2014 elections, but corruption scandals and other missteps have undercut some of the promise of earlier years.

"We have confounded the prophets of doom and achieved a bloodless revolution. We have restored the dignity of every South African,'' Mandela said shortly before stepping down as president in 1999 at age 80.

Story continues below slideshow

Loading Slideshow...
  • NEXT: World leaders react to Mandela's death

  • David Cameron, UK Prime Minister

  • NEXT: Notable names react to death of Nelson Mandela

Nelson Rolihlahla Mandela was born July 18, 1918, the son of a tribal chief in Transkei, one of the future "Bantustans,'' independent republics set up by the apartheid regime to cement the separation of whites and blacks.

Mandela's royal upbringing gave him a dignified bearing that became his hallmark. Many South Africans of all races would later call him by his clan name, Madiba, as a token of affection and respect.

Growing up at a time when virtually all of Africa was under European colonial rule, Mandela attended Methodist schools before being admitted to the black University of Fort Hare in 1938. He was expelled two years later for his role in a student strike.

He moved to Johannesburg and worked as a policeman at a gold mine, boxed as an amateur heavyweight and studied law.

His first wife, nurse Evelyn Mase, bore him four children. A daughter died in infancy, a son was killed in a car crash in 1970 and another son died of AIDS in 2005. The couple divorced in 1957 and Evelyn died in 2004.

Mandela began his rise through the anti-apartheid movement in 1944, when he helped form the ANC Youth League.

He organized a campaign in 1952 to encourage defiance of laws that segregated schools, marriage, housing and job opportunities. The government retaliated by barring him from attending gatherings and leaving Johannesburg, the first of many "banning'' orders he was to endure.

After a two-day nationwide strike was crushed by police, he and a small group of ANC colleagues decided on military action and Mandela pushed to form the movement's guerrilla wing, Umkhonto we Sizwe, or Spear of the Nation.

He was arrested in 1962 and sentenced to five years' hard labour for leaving the country illegally and inciting blacks to strike.

A year later, police uncovered the ANC's underground headquarters on a farm near Johannesburg and seized documents outlining plans for a guerrilla campaign. At a time when African colonies were one by one becoming independent states, Mandela and seven co-defendants were sentenced to life in prison.

"I do not deny that I planned sabotage,'' he told the court. "I did not plan it in a spirit of recklessness, nor because I have any love of violence. I planned it as a result of a calm and sober assessment of the political situation that had arisen after years of tyranny, exploitation and oppression of my people by whites.''

The ANC's armed wing was later involved in a series of high-profile bombings that killed civilians, and many in the white minority viewed the imprisoned Mandela as a terrorist. Up until 2008, when President George W. Bush rescinded the order, he could not visit the U.S. without a waiver from the secretary of state certifying he was not a terrorist.

From the late 1960s South Africa gradually became an international pariah, expelled from the U.N., banned from the Olympics. In 1973 Mandela refused a government offer of release on condition he agree to confine himself to his native Transkei. In 1982 he and other top ANC inmates were moved off Robben Island to a mainland prison. Three years later Mandela was again offered freedom, and again he refused unless segregation laws were scrapped and the government negotiated with the ANC.

In 1989, F.W. de Klerk became president. This Afrikaner recognized the end was near for white-ruled South Africa. Mandela, for his part, continued, even in his last weeks in prison, to advocate nationalizing banks, mines and monopoly industries -- a stance that frightened the white business community.

But talks were already underway, with Mandela being spirited out of prison to meet a white Cabinet minister.

On Feb. 11, 1990, inmate No. 46664, who had once been refused permission to leave prison for his mother's funeral, went free and walked hand-in-hand with Winnie, his wife. Blacks across the country erupted in joy -- as did many whites.

Mandela took charge of the ANC, shared the 1993 Nobel Peace Prize with de Klerk and was elected president by a landslide in South Africa's first all-race election the following year.

At his inauguration, he stood hand on heart, saluted by white generals as he sang along to two anthems: the apartheid-era Afrikaans "Die Stem,'' ("The Voice'') and the African "Nkosi Sikelel' iAfrika'' ("Lord Bless Africa'').

To black South Africans expecting a speedy new deal, Mandela pleaded for patience. The millions denied proper housing, schools and health care under apartheid had expected the revolution to deliver quick fixes, but Mandela recognized he had to embrace free market policies to keep white-dominated big business on his side and attract foreign investment.

For all his saintly image, Mandela had an autocratic streak. When black journalists mildly criticized his government, he painted them as stooges of the whites who owned the media. Whites with complaints were dismissed as pining for their old privileges.

He denounced Bush as a warmonger and the U.S. having ``committed unspeakable atrocities in the world.'' When asked about his closeness to Fidel Castro and Moammar Gadhafi despite human rights violations in the countries they ruled, Mandela explained that he wouldn't forsake supporters of the anti-apartheid struggle.

With his fellow Nobelist, Archbishop Desmond Tutu, he set up the Truth and Reconciliation Commission, which allowed human rights offenders of all races to admit their crimes publicly in return for lenient treatment. It proved to be a kind of national therapy that would become a model for other countries emerging from prolonged strife.

He increasingly left the governing to Deputy President Thabo Mbeki, who took over when Mandela's term ended in June 1999 and he declined to seek another -- a rarity among African presidents.

"I must step down while there are one or two people who admire me,'' Mandela joked at the time. When he retired, he said he was going to stand on a street with a sign that said: "Unemployed, no job. New wife and large family to support.''

His marriage to Winnie had fallen apart after his release and he was now married to Graca Machel, the widowed former first lady of neighbouring Mozambique.

He is survived by Machel; his daughter Makaziwe by his first marriage, and daughters Zindzi and Zenani by his second.