The Nobel Peace laureate, who was elected South Africa's first black president after spending nearly three decades as a political prisoner, died at his Johannesburg home surrounded by his family, after a long battle against lung infection.
The news was announced to the nation and the world by a clearly emotional South African President Jacob Zuma in a live broadcast to the nation.
Mandela was discharged from hospital in September, but continued to receive intensive care at home. He had a long history of lung problems after contracting tuberculosis while in jail.
America's first black President Barack Obama led the worldwide tributes, hailing Mandela as a "profoundly good" man who "took history in his hands and bent the arc of the moral universe towards justice."
Mandela's extraordinary life story, quirky sense of humour and lack of bitterness towards his former oppressors ensured global appeal for the charismatic leader.
Once considered a terrorist by the United States and Britain for his support of violence against the apartheid regime, at the time of his death he was an almost unimpeachable moral icon.
The Nobel Peace Prize winner spent 27 years behind bars before being freed in 1990 to lead the African National Congress (ANC) in negotiations with the white minority rulers which culminated in the first multi-racial elections in 1994.
A victorious Mandela served a single term as president before taking up a new role as a roving elder statesman and leading AIDS campaigner before finally retiring from public life in 2004.
He was a global cause celebre during the long apartheid years, and popular pressure led world leaders to tighten sanctions imposed on South Africa's racist white minority regime.
In 1988 at a concert in Wembley stadium in London, tens of thousands sang "Free Nelson Mandela" as millions more watched on their television sets across the world.
Born in July 1918 in the southeastern Transkei region, Mandela carved out a career as a lawyer in Johannesburg in parallel with his political activism.
He became commander-in-chief of Umkhonto we Sizwe (Spear of the Nation), the armed wing of the by now-banned ANC, in 1961, and the following year underwent military training in Algeria and Ethiopia.
While underground back home in South Africa, Mandela was captured by police in 1962 and sentenced to five years in prison.
He was then charged with sabotage and sentenced in 1964 to life in prison at the Rivonia trial, named after a Johannesburg suburb where a number of ANC leaders were arrested.
He used the court hearing to deliver a speech that was to become the manifesto of the anti-apartheid movement.
"During my lifetime, I have dedicated myself to this 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."
"It is an ideal for which I am prepared to die."
He was first sent to prison on Robben Island, where he spent 18 years before being transferred in 1982 to Pollsmoor prison in Cape Town and later to Victor Verster prison in nearby Paarl.
When he was finally released on February 11, 1990, walking out of prison with his fist raised alongside his then-wife Winnie.
Ex-prisoner 46664 was entrusted with the task of persuading the new president F.W. de Klerk to call time on the era of racist white minority rule.
Mandela and de Klerk were jointly awarded the Nobel Peace Prize in 1993 for their role in the ending of apartheid.
Derived from the Afrikaans word for "apartness," apartheid was a brutally enforced system that discriminated politically and economically against "non-whites" and separated the races in schools, buses, housing and even public toilets and beaches.
After the ANC won the first multi-racial elections, Mandela went out of his way to assuage the fears of the white minority, declaring his intention to establish "a rainbow nation at peace with itself and the world."
Critics said his five-year presidency was marred by corruption and rising levels of crime. But his successors, Thabo Mbeki and Jacob Zuma, have never enjoyed anywhere near the same levels of respect or affection.
In retirement, he focused his efforts on mediating conflicts, most notably in Burundi, as well as trying to raise awareness and abolish the taboos surrounding AIDS, which claimed the life of his son Makgatho.
His divorce from second wife Winnie was finalised in 1996.
He found new love in retirement with Graca Machel, the widow of the late Mozambican president Samora Machel, whom he married on his 80th birthday.
In one of his last foreign policy interventions, he issued a searing rebuke of George W. Bush on the eve of the US invasion of Iraq in 2003, calling him "a president who has no foresight, who cannot think properly, is now wanting to plunge the world into a holocaust".
Bush's predecessor Bill Clinton perhaps had a higher opinion of Mandela.
"Every time Nelson Mandela walks in a room we all feel a little bigger, we all want to stand up, we all want to cheer, because we'd like to be him on our best day," he said.
Mandela is survived by three daughters, 18 grandchildren, nine great-grandchildren and three step-grandchildren. He had four step-children through his marriage to Machel.
His death has left his family divided over his wealth. Some of his children and grandchildren are locked in a legal feud with his close friends over alleged irregularities in his two companies.