Obama was one of close to 100 world leaders at the event in Soweto's World Cup stadium, where songs of praise and revolution, many harking back to the apartheid era that Mandela helped condemn to history, echoed down from the dancing crowds in the stands.
"It is hard to eulogise any man ... how much harder to do so for a giant of history, who moved a nation towards justice," Obama said, after being introduced to wild cheers.
"He was not a bust made of marble, he was a man of flesh and blood," Obama said of the prisoner-turned-president whose life story earned uncommon universal respect.
The event began at midday (5pm Thai time) with a stirring rendition of the national anthem, Nkosi Sikelel' iAfrika (God Bless Africa), led by a mass choir and picked up with enthusiasm by the rest of the stadium.
Some 80,000 had been expected, but the venue was two-thirds full as the ceremony got underway under a curtain of rain that had been falling since the early morning.
Despite the profound sense of national sorrow triggered by Mandela's death last Thursday, the mood was upbeat, with people determined to celebrate the memory of one of the 20th century's towering political figures.
"His long walk is over, he can finally rest," African National Congress (ANC) Vice President Cyril Ramaphosa said in an opening address.
On several occasions, Ramaphosa felt forced to admonish boisterous sections of the crowd for chanting during the speeches.
In his tribute, UN Secretary General Ban Ki-moon noted that Mandela had managed to unite people in death, much as he had in life.
"Look around this stage ... we see leaders representing many points of view ... all here, all united," he said.
Before taking to the stage, Obama shook hands with Raul Castro, leader of long-time Cold War foe Cuba, a US official told AFP.
Crowds had begun gathering at the Soweto stadium before daybreak and, as the gates opened, they swarmed inside the venue where Mandela made his last major public appearance at the 2010 World Cup final.
Wrapped in the South African flag or yellow-green coloured shawls printed with the slogan "Mandela Forever," they danced and sang - oblivious to the constant drizzle.
"He's God given, he's God taken. We will never stop to cherish him," said Shahim Ismail, who took a day off from the sports academy he runs in Johannesburg to attend the event.
"This is once in your life. This is history," said Noma Kova, 36. "I didn't want to watch this on TV."
Mandela's widow, Graca Machel, received a huge ovation as she took her seat on the main stage constructed at one end of the pitch, while the entrance of President Jacob Zuma was roundly booed by a portion of the crowd.
News of Mandela's death at his home in Johannesburg resonated around the world, triggering a wave of loving admiration from political and religious leaders, some of whom agree on little else.
In a nod to Mandela's extraordinary global reach, popularity and influence, the Indian, Brazilian and Namibian presidents, as well as Castro and the vice president of China were selected to deliver eulogies.
In his tribute, Obama took a swipe at authoritarian leaders who spoke of embracing Mandela's legacy without acting upon it.
"There are too many leaders who claim solidarity with Madiba's struggle for freedom, but do not tolerate dissent from their own people," he said,
The memorial event was part of an extended state funeral that will culminate in Mandela's burial on Sunday in the rural village of Qunu where he spent his early childhood.
Although Mandela had been critically ill for months, the announcement of his death was a body blow for this recently reborn nation.
He had been out of public life for more than a decade, but South Africans looked to his unassailable moral authority as a comforting constant in a time of uncertain social and economic change.
Ahead of the burial in Qunu, Mandela's body will lie in state for three days from Wednesday in the amphitheatre of the Union Buildings in Pretoria where he was sworn in as president in 1994.
Each morning, his coffin will be borne through the streets of the capital in a funeral cortege, to give as many people as possible the chance to pay their final respects.
British Prime Minister David Cameron, French President Francois Hollande and Afghan President Hamid Karzai were among the leaders attending the memorial ceremony.
"We were told it was appropriate to wear a black tie," Cameron said after arriving at the stadium in Soweto.
"But when you come and your hear this great noise and this great atmosphere of celebration, it is clear that people here in South Africa want to, yes, say goodbye to this great man, yes commemorate what he did, but also celebrate his life and celebrate his legacy," he said.
Africa was represented by Nigeria's Goodluck Jonathan and more than a dozen other heads of state and government.
Singer-activist Bono and South African actress Charlize Theron were among the celebrity mourners.