US President Barack Obama has called on Americans to defend their democracy in his farewell speech in Chicago. "By almost every measure, America is a better, stronger place" than it was eight years ago, he told thousands of supporters.
But he warned "democracy is threatened whenever we take it for granted".
The country's first black president, now 55, was first elected in 2008 on a message of hope and change.
His successor, Donald Trump, has vowed to undo some of Mr Obama's signature policies. He will be sworn into office on 20 January.
Striking an upbeat tone, Mr Obama said that the peaceful transfer of power between presidents was a "hallmark" of American democracy. But, he outlined three threats to American democracy - economic inequality, racial divisions and the retreat of different segments of society into "bubbles", where opinions are not based on "some common baseline of facts".
As he leaves the White House, President Obama is viewed favourably by 57% of Americans, according to an Associated Press-NORC Center for Public Affairs Research poll, a similar level to Bill Clinton when he left office.