He was 95.
He passed away at his Johannesburg home surrounded by family and friends after a prolonged lung infection.
South African President Jacob Zuma made the announcement in a nationally televised address saying: "Fellow South Africans, our beloved Nelson Rolihlahla Mandela, the founding president of our democratic nation, has departed.
"He is now resting. He is now at peace.
"Our nation has lost its greatest son," he continued. "Our people have lost their father."
Mr Mandela, whose successful struggle against South Africa's apartheid system of racial segregation and discrimination made him a global symbol for the cause of human rights, had been receiving round-the-clock intensive care from 22 military and other doctors since September, when he was discharged from a three-month hospital stay for a lung infection.
Mr Mandela, who spent 27 years in prison, led his country to democracy, and became its first black president, will receive a state funeral. South African flags will be flown at half mast.
Earlier yesterday the president's friends and loved ones had gathered at his house in South Africa, when Mr Mandela was described as "on his death-bed".
Two of Mr Mandela's granddaughters and Bantu Holomisa, a close family friend, were among those seen entering the house in the Johannesburg suburb of Houghton, along with military personnel responsible for the former president's health.
The Nelson Mandela Foundation, the Nelson Mandela Children's Fund and the Mandela Rhodes Foundation, charities which he established, said they would continue to "dedicate ourselves to continue promoting his extraordinary legacy".
The charities said: "We want to express our sadness at this time. No words can adequately describe this enormous loss to our nation and to the world.
"We give thanks for his life, his leadership, his devotion to humanity and humanitarian causes. We salute our friend, colleague and comrade and thank him for his sacrifices for our freedom."
With advancing age and bouts of illness, Mr Mandela had retreated to a quiet life at his boyhood home in the nation's Eastern Cape Province, where he said he was most at peace.
News of his death came as the Duke and Duchess of Cambridge attended the London premiere of the Mandela biopic Long Walk to Freedom. Mr Mandela's daughter Zindzi, who also attended the screening at the Odeon in Leicester Square, had earlier told journalists at the event that her father was "fine" but "frail".
After the film, Prince William spoke of the "extremely sad and tragic news". "We were just reminded of what an extraordinary and inspiring man Nelson Mandela was and my thoughts and prayers are with him and his family right now," he said.
Mr Mandela's public appearances had become increasingly rare as he dealt with his declining health. His death prompted a swift outpouring of poignant and emotional tributes from all walks of life.
David Cameron, who met Mr Mandela twice, once in South Africa while leader of the opposition, and in London in 2010, said: "A great light has gone out in the world. Nelson Mandela was a hero of our time."
The flag at Number 10 will be flown at half-mast, as will those at Glasgow City Chambers and the Town House in Aberdeen.
First Minister Alex Salmond said: "With the passing of Nelson Mandela, the world has lost a towering statesman and outstanding political leader."
US President Barack Obama mourned the passing of one of the most "influential, courageous, and profoundly good" leaders of all time who "achieved more than could be expected of any man".
He added: "We've lost one of the most influential, courageous and profoundly good human beings that any of us will share time with. He no longer belongs to us, he belongs to the ages.
"His commitment to transfer power and reconcile with those who jailed him set an example that all humanity should aspire to. I am one of the countless millions who drew inspiration from Nelson Mandela's life. I cannot fully imagine my own life without the example set by Nelson Mandela."
Former US President Bill Clinton said: "I will never forget my friend Madiba."
American civil rights leader Jesse Jackson said Mr Mandela's "imprint" would be "everlasting", adding: "My heart weighs heavy about his transition."
UN secretary-general Ban Ki-moon described Mr Mandela as "a giant for justice" whose "selfless struggle for human dignity, equality and freedom" inspired many people around the world.
Former prime minister Tony Blair said the political leader was a "great man" who had made racism "not just immoral but stupid". He added: "He was a unique political figure at a unique moment in history."
Mr Mandela is thought to have suffered damage to his lungs while working in a prison quarry. He contracted tuberculosis in the 1980s while being held in jail on Robben Island.