They drove and walked through the darkness, from impoverished townships and wealthy suburbs, to reach the home of the man who liberated South Africa from apartheid.

And in the pre-dawn hours, they partied with dance and song in a joyous vigil. The people of South Africa were not tearfully mourning Nelson Mandela, for they had known he would depart soon. They were celebrating the 95 years of his life – a life that had brought freedom and forgiveness to a country where brutal repression had reigned.

Mr. Mandela, who had been in critical condition since June, died peacefully at his Johannesburg home, with his family around him, at 8:50 p.m. on Thursday night.

Story continues below advertisement

"Our nation has lost its greatest son. Our people have lost a father," South African President Jacob Zuma said in a sombre speech to the nation just before midnight, broadcast on all major television channels.

"He is now resting. He is now at peace. ... Although we knew this day would come, nothing will diminish our sense of a profound and enduring loss."

Mr. Mandela, the 95-year-old hero of the anti-apartheid movement and the first democratic president of South Africa, had been retired from politics for more than a decade and had not appeared in public for the past three years. Everyone had known that his departure was very near.

But his death was still a moment of great poignancy for South Africans. "This is our moment of greatest sorrow," Mr. Zuma told the nation in his speech.

He said Mr. Mandela will be given a state funeral and all flags will be lowered to half-mast until the end of the funeral and memorials, expected to last for the next 10 days.

"God bless Africa," Mr. Zuma said, echoing the South African national anthem, as he concluded the brief and solemn announcement on the television networks.

Hundreds of South Africans of all races and creeds, including families with blanket-clad infants, toddlers in strollers and children in pyjamas, began to gather at the Mandela home in the Johannesburg suburb of Houghton within minutes of the late-night announcement.

Story continues below advertisement

Story continues below advertisement

They sang the greatest of the struggle songs, they danced, they waved banners and flags, they lit candles and brought flowers – all to celebrate Mr. Mandela's historic achievements in defeating apartheid and uniting a troubled nation.

Eric Williams, a 46-year-old advertising manager in a town south of Johannesburg, woke up on his sofa at home, saw the televised announcement, jumped in his car and drove for 45 minutes to the vigil at the Mandela home, still wearing his bathrobe and slippers.

"If I could change places with Nelson Mandela right now and give him my life, I would," Mr. Williams said. "He gave his all to us. I just wanted to come here and properly say 'Thank you' to him."

Less than an hour after the announcement, U.S. President Barack Obama went on U.S. television to express his condolences, quoting Mr. Mandela's famous speech in 1964 – when he faced the death penalty at the Rivonia trial – about the principles of racial freedom and equality.

"Today he's gone home," Mr. Obama said. "And we have lost one of the most influential, courageous, and profoundly good human beings that any of us will share time with on this Earth. He no longer belongs to us – he belongs to the ages. I'm one of the countless millions who drew inspiration from Nelson Mandela's life."

A similar tribute came from South Africa's ruling party, the African National Congress, which Mr. Mandela had led until his retirement. "Our nation has lost a colossus, an epitome of humility, equality, justice, peace and the hope of millions," ANC secretary-general Gwede Mantashe said.

Story continues below advertisement

"The large African baobab, who loved Africa as much as he loved South Africa, has fallen," he said. "Its trunk and seeds will nourish the earth for decades to come."

South Africans will remember "his ever-present smile, the cheerful Madiba jive," Mr. Mantashe said. "We recall the strength of his fist punching the air as he stepped out of prison after 27 years; and his sternness during the negotiations for the freedom of our beloved country."

Mr. Mandela's funeral will be one of the most complex ever organized, with the most powerful leaders from scores of countries attending, among them Prime Minister Stephen Harper.

"He is the hero of the planet," said one diplomat in South Africa. "It's going to be the biggest state funeral since Winston Churchill, and I think any country would struggle to organize that."

A long line of anti-apartheid veterans and global political leaders went on television in South Africa and around the world to give their sympathies and tributes to Mr. Mandela.

"In your illness and death, you once more unite a huge diversity of people," said Ahmed Kathrada, his close friend and comrade, who spent nearly as long in prison as the 27 years that Mr. Mandela served.

"You continue to bring unity to a world so often torn apart by intolerance," he said. "Your power to inspire and bring out the good in people grows with each year that passes."

Mr. Zuma urged South Africans to follow the values of its first democratic president. "Let us reaffirm his vision of a society in which none is exploited, oppressed or dispossessed by another," he told the nation.

"Let us commit ourselves to strive together – sparing neither strength nor courage – to build a united, non-racial, non-sexist, democratic and prosperous South Africa. Let us express, each in our own way, the deep gratitude we feel for a life spent in service of the people of this country and in the cause of humanity."

Geoffrey York is The Globe and Mail's Africa correspondent.He has been a foreign correspondent for the newspaper since 1994, including seven years as the Moscow Bureau Chief and seven years as the Beijing Bureau Chief.He is a veteran war correspondent who has covered war zones since 1992 in places such as Somalia, Sudan, Chechnya, Iraq and Afghanistan. More

The Globe invites you to share your views. Please stay on topic and be respectful to everyone. For more information on our commenting policies and how our community-based moderation works, please read our Community Guidelines and our Terms and Conditions.

We’ve made some technical updates to our commenting software. If you are experiencing any issues posting comments, simply log out and log back in.