Barack Obama is jetting out of Britain after provoking a whirlwind of cheers and jeers during what is likely to be his final visit to the country as US president.
As Mr Obama headed to Germany on the last leg of his tour of the Middle East and Europe, his dramatic intervention in the Brexit battle continued to infuriate the Leave camp, but a warm response at a town hall-style meeting with young people in London gave him a rapturous goodbye.
Following the question and answer session in Westminster, Mr Obama met Labour leader Jeremy Corbyn, before heading to Hertfordshire for a game of golf with Prime Minister David Cameron.
The president used the town hall meeting to urge young people to reject cynics telling them they cannot change the world.
He praised the close relationship between the US and the UK, which he said had improved dramatically since the British "burned down my house" - a reference to the torching of the White House in the war of 1812-1814.
The president insisted now was the best time in human history to be alive as he urged the audience to ignore cynical voices saying that nothing could change.
"Take a longer, more optimistic view of history," Mr Obama said.
Asked about his biggest achievement in the past eight years as president, Mr 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.
Though he did not refer directly to his controversial remarks that a post-Brexit Britain would be at the "back of the queue" when it came to American trade deals, Mr Obama said that generally such economic agreements were difficult due to "parochial" interests and "factions" within countries.
Mr 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."
Asked which grass-roots movements had been most impressive, Mr 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 said.
The president said he started out backing civil partnerships but gay friends helped persuade him that did not go far enough and full marriage equality was needed.
Mr Obama praised Mr Cameron for being "ahead of the curve" on LGBT rights issues.
A Sikh questioner called for movement on issues like discrimination at airport security. Mr 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 warned that 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," he said.
Asked about the peace process in Northern Ireland, Mr Obama said it was an example of what could be achieved when the US and Britain worked together.
He 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," he said.
Though billed as an opportunity for young people to connect with Mr Obama, there were also some famous faces in the audience including Annie Lennox, Benedict Cumberbatch, Holly Valance, Bank of England governor Mark Carney and designer Ozwald Boateng.