US President Barack Obama has given a farewell speech in Chicago, reflecting on his time in office.
He said he wanted to return to "where it all started" for him and First Lady Michelle Obama, instead of delivering the speech from the White House.
"Tonight it's my turn to say thanks," he said, addressing the American people, both those who agreed with him and those who opposed his policies.
"Every day I have learned from you. You made me a better president and made me a better man."
Pointing to his early years as a community organiser in Chicago, he said he still believed in the power of ordinary people to create change.
Obama harked back to the message of his first campaign for president in 2008.
At one point, he was interrupted by chants of "Four more years!"
Obama said: "I can't do that."
In the aftermath of Republican Donald Trump's election as the next president, Obama acknowledged that the US' progress had been "uneven."
He said for "every two steps forward, it often feels we take one step back."
But Obama said the US strives for "forward motion, a constant widening of our founding creed to embrace all, and not just some."
Obama said the world would witness the peaceful transfer of power to a new president on January 20, drawing some jeers ahead of Trump's presidency.
Obama says he committed to Trump that his administration would "ensure the smoothest possible transition" just as his predecessor, President George W. Bush, did for him.
The outgoing president says "it's up to all of us to make sure our government can help us meet the many challenges we still face."
Obama says the nation's politics need to reflect "the decency" of the American people..
Obama said the US contained great potential, "but that potential will only be realised if our democracy works, only if our politics better reflects the decency of our people - only if all of us, regardless of party affiliation help restore the sense of common purpose we so badly need right now."
Obama made the remarks without directly criticising Trump's rhetoric as he did on the campaign trail.
He acknowledged that "stark inequality" was corrosive to the nation's democratic principles, a nod to the economic uncertainty that helped Trump win the White House last November.
Obama says many are convinced that the "game is fixed against them" and government only serves powerful interests.
The president described that as a "recipe for more cynicism and polarisation in our politics."