JOHANNESBURG (CNN) -- They gathered in the tens of thousands -- presidents, prime ministers, royals, celebrities and ordinary South Africans -- all united to say farewell to a man hailed as a global symbol of reconciliation.
In what has been billed as one of the largest gatherings of global leaders in recent history, representatives from around the world joined street sweepers, actors and religious figures to pay tribute to Nelson Mandela.
From President Barack Obama to Cuba's Raul Castro, praise came from all sides in a four-hour memorial service at Johannesburg FNB stadium for the revered statesman, who died Thursday at age 95.
"We will never see the likes of Nelson Mandela again," Obama said in a speech to roaring cheers.
"To the people of South Africa -- people of every race and every walk of life -- the world thanks you for sharing Nelson Mandela with us," he said, calling him a "giant of history."
Gray skies and pouring rain throughout the service did little to dampen the mood.
Inside the stadium, the atmosphere was celebratory, with people dancing, blowing vuvuzela plastic horns and singing songs from the anti-apartheid struggle.
Around them, huge poster pictures of Mandela hung inside the stadium. In that same place 23 years earlier, Mandela had delivered his first speech after he was released from prison, hailed by supporters as the hope of a new South Africa.
Also known as Soccer City, the stadium was where Mandela made his last public appearance at the World Cup final in July 2010.
On Tuesday, many people carried banners honoring "Madiba," Mandela's traditional clan name. Others were draped in materials covered with his face or the green, yellow, black, red and blue colors of the South African flag.
Some had skipped work and lined up for hours to secure seats so that they could pay their respects to a man who's considered a moral compass and South Africa's symbol of the struggle against racial oppression.
"There is no one like Madiba. He was one of a kind," South African President Jacob Zuma said.
"Everyone has had a Mandela moment when this world icon has touched their lives."
The memorial service, coinciding with U.N. Human Rights Day, was the centerpiece of a week of mourning.
It began with a marching band playing the national anthem.
The joyous cries died down as speeches from Mandela's family and friends, members of the African National Congress, as well as a fellow Robben Island prison inmate, began.
Anguished faces listened quietly as a sorrowful chant to "Tata Madiba" filled the air. "Tata" means "father" in Mandela's Xhosa tribe.
'The world has lost a beloved friend and mentor'
Mandela's gift for uniting foes across political and racial divides was still evident at the service.
Walking up the stairs onto the stage to deliver his speech, Obama shook hands with Castro, an unprecedented gesture between the leaders of two nations that have been at loggerheads for more than half a century.
He earlier gave a warm greeting to Brazilian President Dilma Rousseff, kissing her on both cheeks, despite recent tension between the two countries over reports the U.S. government was spying on her communications.
Obama, who like Mandela was his nation's first black president, has cited Mandela as his own inspiration for entering politics.
He said his death should prompt self-reflection.
"With honesty, regardless of our station or our circumstance, we must ask: How well have I applied his lessons in my own life?" Obama said.
"It is a question I ask myself, as a man and as a president. We know that like South Africa, the United States had to overcome centuries of racial subjugation. As was true here, it took sacrifice -- the sacrifices of countless people, known and unknown -- to see the dawn of a new day."
The presidents of Namibia, India, Cuba and South Africa were also designated speakers, as were Roussef and Chinese Vice President Li Yuanchao.
"South Africa has lost a hero, they have lost a father. The world has lost a beloved friend and mentor," United Nations Secretary-General Ban Ki-moon said to loud cheers.
"Nelson Mandela was more than one of the greatest leaders of our time, he was one of the greatest teachers. And he taught by example."
The stadium, which can seat around 90,000 people, was not full, and speeches were hard to hear at times. But the celebratory mood was evident as thousands clapped and waved South African flags throughout the service.
Presidents and celebrities
Foreign guests included British Prime Minister David Cameron, the Prince of Wales, French President Francois Hollande and Liberian President Ellen Johnson Sirleaf.
"It means a lot because it really is to say goodbye to an extraordinary man and to commemorate someone who did so much not just for South Africa, but also for the world in terms of the inspiration that he gave," Cameron told CNN's Christiane Amanpour.
Nobel Peace Prize laureate Archbishop Desmond Tutu and members of The Elders, a group of retired statesmen founded by Mandela and others, were also in attendance, including former U.N. Secretary-General Kofi Annan and former U.S. President Jimmy Carter.
The crowds cheered loudly and clapped as a huge screen showed famous faces, such as F.W. de Klerk, the last leader of white South Africa, who shared a Nobel Peace Prize with Mandela for helping to end apartheid.
Mandela's widow, Graca Machel, and his former wife Winnie Mandela embraced and kissed as they arrived.
The world of entertainment also was well represented, with South African actress Charlize Theron and U2's Bono in attendance. Celebrity guests also included model Naomi Campbell.
With 91 heads of state attending, security was tight.
Working off plans developed for years in secret, the South African government planned to use an elite military task force, sniper teams and canine teams to help secure the stadium, CNN's Arwa Damon reported Monday. In addition, helicopters and military jets frequently flew overhead.
U.S. officials said they were satisfied with security arrangements.
The event rivaled other significant state funerals in recent decades, such as that of former British Prime Minister Winston Churchill in 1965 and the 2005 funeral of Pope John Paul II, which attracted some 2 million people to Rome -- among them four kings, five queens, at least 70 presidents and prime ministers and the leaders of 14 other faiths.
Security was also stepped up outside Mandela's home, where crowds danced under umbrellas. Some even enjoyed the rain, jumping into puddles.
"We want to respect our father of the nation, our father of the country. That is why we left work to pay that respect to him," one South African told CNN.
State funeral on Sunday
Crews had worked overtime Monday to prepare the stadium for the service.
The government set up overflow locations at stadiums and other facilities throughout the country.
With private vehicles banned from the area around the stadium, the government pressed buses from around the country into service and stepped up train service to move the crowds.
In Soweto township, where Mandela lived before he was imprisoned for 27 years, people waited for three hours for buses to take them to the stadium. Unfazed by the wait, they sang and danced.
While Tuesday's memorial is the first major event honoring Mandela since his death, it won't be the last.
A state funeral will be held Sunday in Mandela's ancestral hometown of Qunu in South Africa's Eastern Cape province.
Other speakers at Tuesday's service included Mandela's friend and fellow anti-apartheid activist Archbishop Tutu
"We promise God that we are going to follow the example of Nelson Mandela," he said to loud cheers.
Mandela family members, including his grandchildren, also spoke.
Paying tribute to his uncle, Gen. Thanduxolo Mandela said his family has gone through waves of grief, sorrow and anguish after his death.
But "today, more than any other feeling my family holds is thankfulness for that wonderful life," he said, also giving thanks for the outpouring of respect from around the world
"This universal show of unity is a true reflection of all that Madiba stood for -- peace, justice, unity of all mankind. Let us pledge to keep Madiba's dream alive."
CNN's Michael Pearson, Athena Jones, Holly Yan, Chris Cuomo, Kim Norgaard, Robin Curnow, Arwa Damon Errol Barnett and David McKenzie contributed to this report.
™ & © 2013 Cable News Network, Inc., a Time Warner Company. All rights reserved.