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.
"Our beloved Nelson Rolihlahla Mandela, the founding president of our democratic nation has departed," said Zuma, who was also imprisoned on Robben Island.
"Our nation has lost its greatest son. Our people have lost a father."
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.
After huddling around radios and televisions to hear the news, South Africans poured onto the streets near his home, walking arm-in-arm to join a crowd of hundreds singing songs celebrating his struggle against apartheid.
"My heart is full of joy and sadness at the same time," said Ashleigh Williams, one of those outside the house.
"He left a great legacy. I don't think anyone will ever be able to fill his shoes."
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."
Archbishop emeritus Desmond Tutu lauded his compatriot and fellow Nobel peace laureate as the man who taught a deeply divided nation how to come together.
"Over the past 24 years Madiba taught us how to come together and to believe in ourselves and each other. He was a unifier from the moment he walked out of prison," Tutu said.
"The sun will rise tomorrow, and the next day and the next... It may not appear as bright as yesterday, but life will carry on."
Speaking on behalf of the United Nations, Secretary General Ban Ki-moon declared Mandela a "giant for justice."
"Many around the world were influenced by his selfless struggle for human dignity, equality and freedom. He touched our lives in deeply personal ways," Ban told reporters.
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.
From prisoner to global peace icon
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.
At our best, 'we'd like to be him': Clinton
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.
AFP