SOWETO, South Africa -- In any other life, their paths might never have crossed.

But on Tuesday, the most powerful people in the world sat with some of the least powerful -- men, women and children struggling to survive -- and for one rainy afternoon they shared something in common: their adoration for Nelson Mandela.

Together they remembered the anti-apartheid icon, in a boisterous ceremony at a soccer stadium in an emotional place -- Soweto -- where the challenges of black South Africans helped bring down white minority rule nearly 20 years ago.

Together they sang and clapped, memorializing Mandela as a racial healer, a figure so humble and transcendent that he felt comfortable with rich and poor, young and old, black and white.

"Over 30 years ago, while still a student, I learned of Mandela and the struggles in this land," President Barack Obama said in his eulogy at the stadium, where tens of thousands endured a steady rain.

"It stirred something in me. It woke me up to my responsibilities -- to others, and to myself -- and set me on an improbable journey that finds me here today. ... He speaks to what is best inside us."

Nomathemba Mapengeza, 55, a nurse from Soweto, said she, too, had learned to be a better person, to set aside the hatred that she felt for the whites who subjugated her and her ancestors, and to reconcile with her nation's ugly past.

"He taught us to love one another," said Mapengeza, swaying to the music of a South African choir on the field.

The four-hour service was filled with emotional tributes and joyous song. The rich crowded with the poor, children with the elderly, all to remember Mandela, who died Thursday at age 95.

"Only Mandela can bring together people of different races, cultures, even religions," said Nkuli Simelane, 30, a tour guide. "He didn't want blacks to be on one side and the rich on one side. He wanted everyone to be together."

Gen. Thanduxolo Mandela, a family member, echoed those sentiments in his eulogy.

"In his lifetime, Madiba mingled with kings, queens and presidents. At the core, he was a man of the people. A simple man," said the general, referring to Mandela by his Xhosa clan name.

"I am sure Madiba is smiling from above as he looks down at the multitude of diversity gathered here, for this is what he strove for -- the equality of man, the brotherhood of humanity."

Many in the stadium carried umbrellas and South African flags, or were draped in the green, yellow and black colors of the ruling African National Congress. Some blew plastic horns known as vuvuzelas. Others unfurled large banners showing Mandela's face.

Two giant television screens alternated between showing images of Mandela and the dancing crowds.

More than 90 heads of state and governments attended the ceremony at the First National Bank Stadium, more than those who attended the 2005 funeral of Pope John Paul II.

The list of dignitaries included former U.S. presidents George W. Bush, Bill Clinton and Jimmy Carter. Many African leaders also came. Other leaders arrived from as far away as Afghanistan, Australia and Scandinavia.

Scores of police were stationed outside and inside, inspecting bags and keeping watch.

The stadium is where Mandela was last seen in public, during soccer's World Cup competition in 2010. It was a fitting place to say farewell, not only because of its size but the symbolism of its location, in Soweto. The once-segregated former township was at the center of the anti-apartheid protests in the 1970s and 1980s. Mandela, who owned a house in Soweto, became South Africa's first black president in 1994 after the nation's first multiracial elections.

Francois Pienaar, captain of the South African rugby team that won the 1995 World Cup, described the ceremony as "very emotional, very happy, very sad, painful and reflective."

"To see all these people come out to say farewell is very special," said Pienaar, who worked closely with Mandela to use the World Cup victory to reconcile a nation divided by its past.

Pienaar said that he last saw Mandela three years ago and that he will always remember the leader's broad smile.

"It was a beautiful smile. He was so genuine," he said. "He was a real person."

Other stadiums in Johannesburg were equipped with giant screens to accommodate crowds of people who could not get to the stadium where the ceremony was taking place.

At Tuesday's memorial ceremony, both the powerful and the ordinary expressed hope that Mandela's legacy will live on.

"He was a motivation for our kids," said Rosinal Kawana, who works at a supermarket.

And said Obama: "We will never see the likes of Nelson Mandela again. But let me say to the young people of Africa, and young people around the world: You can make his life's work your own."

By 4:30 p.m., everyone had exited through the same gates of the stadium, the rich and powerful to their shiny black cars, the rest to buses and trains, and returned to their separate lives.

After Tuesday's ceremony, Mandela's body will lie in state for three days in the capital, Pretoria, once the epicenter of white rule.

On Sunday, he will be buried in his ancestral village of Qunu, in the Eastern Cape.