Barack Obama held a Q&A session with young people in Westminster on the second full day of his UK visit.
He took questions from the crowd of young ordinary Brits - though a few famous faces also made an appearance, including Benedict Cumberbatch, Annie Lennox and Bank of England governor Mark Carney - at a town hall-style meeting in Lindley Hall.
These are the main things he talked about:
1. World progress
Obama urged young people to reject cynics telling them they cannot change the world. He insisted now was the best time in human history to be alive and that progress is possible. "Take a longer, more optimistic view of history," he said.
2. His legacy
Asked about his biggest achievement in the past eight years as president, Obama cited bringing in health insurance and dealing with the financial crash.
"Saving the world economy from a great depression, that was pretty good. I'll look at the scorecard at the end. I think I have been true to myself," he added.
3. Race and discrimination
Obama said racial tensions in America still needed to be dealt with and people could not be complacent just because an African-American was in the White House.
"One of the dangers is that by electing a black president people say there must be no problem at all."
A Sikh questioner called for movement on issues like discrimination at airport security. Obama insisted it was explicit US policy not to racially profile at airports.
The president also praised the Black Lives Matter movement for raising awareness but cautioned you "can't just keep on yelling" at people who want to sit down and talk.
"Seek out people who don't agree with you. That will teach you to compromise. Compromise does not mean surrendering what you believe."
Obama said the greatest allies in the fight against terrorism were Muslim Americans.
"If we engage in Islamophobia we are not only betraying what is essential to us but, just as a practical matter, we are engaging in self-defeating behaviour if we are serious about terrorism."
5. The LGBT community
Asked about which grassroots movements have been most impressive, Obama cited the marriage equality campaign. "It's probably been the fastest set of changes in terms of a social movement that I've seen," he added.
He was urged to do more for the trans community by 20-year-old Maria Munir, a Pakistani Muslim student who came out to him as a non-binary person at the meeting.
Addressing the president, Munir said: "I really, really wish that yourself and David Cameron would take us seriously as transgender people."
The President said he was "incredibly proud" of the steps Munir had taken to speak out and said from his own perspective "a lot of serious steps" are being taken to address these issues.
He added: "I can't speak for David Cameron although I will say that on LGBT issues I think David's been ahead of the curve."
6. The peace process in Northern Ireland
Obama said it was an example of what can be achieved when the US and Britain work together. He described it as a "story of perseverance" that inspires other nations.
He said: "In Colombia and Latin America right now they're trying to undergo a peace process and they've actually brought people from Northern Ireland to come and describe how you overcome years of enmity and hatred and intolerance, and try to shape a country that is unified."
He added that "one of the most important" things is the simple act of recognising the humanity of those on the other side of the argument.
He said it requires "forging a new identity that is about being from Northern Ireland as opposed to being Unionist or Sinn Fein".