"Born during World War I, far from the corridors of power, a boy raised herding cattle and tutored by elders of his Thembu tribe - Madiba (Mandela's clan name) would emerge as the last great liberator of the 20th century," Obama said. (Agencies)
The US President then compared Mandela, who died at the age of 95 after protracted illness on December 5, to other great leaders of the 20th century.
"Like Gandhi, he would lead a resistance movement – a movement that at its start held little prospect of success. Like King, he would give potent voice to the claims of the oppressed, and the moral necessity of racial justice," Obama told the gathering with nearly 100 world leaders, including President Pranab Mukherjee, in attendance.
"Emerging from prison, without the force of arms, like Abraham Lincoln, he held his country together when it threatened to break apart," Obama said to applause from the over 80,000 crowd who braved the rain to attend the rare event.
"For nothing he achieved was inevitable. In the arc of his life, we see a man who earned his place in history through struggle and shrewdness, persistence and faith. He tells us what's possible not just in the pages of dusty history books, but in our own lives as well." he said.
Earlier, South African President Jacob Zuma was booed by the crowd at the stadium when his images flashed up on the big screens.
In contrast, Obama received a huge ovation as he arrived an hour late for the emotional event, one of the largest such gatherings in generations.
Before Obama, UN chief Ban-Ban Ki-moon addressed the crowd, saying, "He (Mandela) showed the awesome power of forgiveness - and of connecting people with each other... the
true meaning of peace."
"He has done it again," the UN Secretary General said, referring to leaders of different political ideologies gathered to pay homage to Mandela.
"Look around this stadium and this stage. We see leaders representing many points of view, and people from all walks of life. All here, united," Ban said.
Obama drew the loudest cheers from the crowd, from the time he entered the stadium to the duration of his speech. The US President reiterated that Mandela had a deep impact on his and his wife Michelle's life, saying he asks himself how well he has applied Mandela's lessons to himself as a man and as president.
"Michelle and I are the beneficiaries of that struggle. But in America and South Africa, and countries around the globe, we cannot allow our progress to cloud the fact that our work is not done," Obama said.
He appealed to people globally to work on behalf of justice and not get complacent as more work needed to be done.
"We, too, must act on behalf of justice. There are too many of us who happily embrace Madiba's legacy of racial reconciliation, but passionately resist even modest reforms that would challenge chronic poverty and growing inequality," Obama said.
"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.
It is very rare for an event to be attended by four American Presidents, as Obama was joined by former US Presidents Bill Clinton, Geaorge W Bush and Jimmy Carter for the memorial service.
"He was not a bust made of marble, he was a man of flesh and blood. He showed us the power of action, of taking risks on behalf of our ideals," Obama said.
To loud cheers, quoting the African concept of Ubuntu, sharing and caring for your fellowman, Obama said this captured Mandela's greatest gift: "He not only embodied Ubuntu, but taught millions to find it within themselves."
Obama acknowledged that he and other world leaders still had a lot of work to do to achieve Mandela's ideals.
"There are too many of us on the side-lines comfortable in complacency or cynicism, but our voices must be heard. The questions we face today on how to promote equality and justice; how to uphold democracy and human rights; how to end conflict and sectarian war; these things do not have answers," Obama said asking people to introspect on this solemn occasion.
"Born during World War I, far from the corridors of power, a boy raised herding cattle and tutored by elders of his Thembu tribe - Madiba (Mandela's clan name) would emerge as the last great liberator of the 20th century," Obama said.