"He no longer belongs to us. He belongs to the ages," Obama said in a sombre appearance at the White House.
"I am one of the countless millions who drew inspiration from Nelson Mandela's life," he continued. "And like so many around the globe, I cannot fully imagine my own life without the example that Nelson Mandela set."
Mandela died earlier Thursday at 95. He had spent much of the year in and out of the hospital, and his illness prevented a meeting with Obama when the U.S. president visited South Africa this summer.
Still, the former South African president's legacy influenced nearly every aspect of Obama's trip. Obama, along with wife Michelle and daughters Malia and Sasha, made an emotional visit to Robben Island, standing quietly together in the tiny cell where Mandela spent 18 of his 27 years in prison. Obama also met privately with members of Mandela's family.
The president is likely to travel to South Africa for Mandela's funeral, though a trip has not yet been announced. Other former U.S. presidents and dignitaries are also likely to attend. Obama ordered that the U.S. flag be flown at half-staff at the White House, federal buildings, military bases and embassies until sunset Monday. The White House said he also telephoned his condolences to South African President Jacob Zuma.
Obama's political rise has drawn inevitable comparisons to Mandela's. Both are Nobel Peace Prize winners and the first black men elected to lead their countries.
However, the two men met in person only once, a hastily arranged meeting in a Washington hotel room in 2005 when Obama was a U.S. senator. A photo of the meeting hangs in Obama's personal office at the White House, showing a smiling Mandela sitting on a chair, his legs outstretched, as the young senator reaches down to shake his hand. A copy of the photo also hung in Mandela's office in Johannesburg.
The two presidents did speak occasionally on the phone, including after the 2008 election, when Mandela called Obama to congratulate him on his victory. The U.S. president called Mandela in 2010 after the South African leader's young granddaughter was killed in a car accident. Obama also wrote the introduction to Mandela's memoir, "Conversations With Myself."
Mandela had already shaped Obama's political beliefs well before their first encounter. As a student at Occidental College in Los Angeles, Obama joined protests against the school's investments during South Africa's apartheid era. In 1981, Obama focused his first public political speech on the topic.
"It's happening an ocean away," Obama said, according to a retelling of the story in his memoir "Dreams From My Father." ''But it's a struggle that touches each and every one of us. Whether we know it or not. Whether we want it or not."
Follow Julie Pace at http://twitter.com/jpaceDC