The UK must stay in the European Union to continue to have influence on the world stage, US President Barack Obama has told the BBC.
He said the UK's EU membership "gives us much greater confidence about the strength of the transatlantic union".
Speaking to the BBC's North America editor Jon Sopel, he said the EU "made the world safer and more prosperous".
He also admitted that the failure to pass "common sense gun safety laws" in the US was his biggest frustration.
Mr Obama said the UK was America's "best partner" because of its willingness to project power beyond its "immediate self-interests to make this a more orderly, safer world".
He also called UK Prime Minister David Cameron an "outstanding partner" and congratulated his government for meeting the Nato target of spending 2 percent of GDP on defence.
Mr Obama denied putting pressure on Mr Cameron to meet that target but said there was an "honest conversation" between the two leaders.
He was speaking to the BBC at the White House before departing for Kenya, where he begins a short tour of Africa.
With just 18 months left in power, he said the area he has been "most frustrated and most stymied" in was gun control "even in the face of repeated mass killings".
"If you look at the number of Americans killed since 9/11 by terrorism, it's less than 100. If you look at the number that have been killed by gun violence, it's in the tens of thousands," Mr Obama said.
"For us not to be able to resolve that issue has been something that is distressing," he added.
Mr Obama has pushed for stricter gun control throughout his presidency but has been unable to secure any significant changes to the laws.
After nine African-American churchgoers were killed in South Carolina in June, he admitted "politics in this town" meant there were few options available.
He vowed to continue fighting for tougher gun laws during his remaining months in power, but the BBC's Jon Sopel said the president did not sound very confident.
On race relations, Mr Obama told the BBC that "recent concerns around policing and mass incarcerations are legitimate and deserve intense attention".
But progress was being made, he insisted, adding that children growing up during his presidency "will have a different view of race relations in this country and what's possible".
"There are going to be tensions that arise. But if you look at my daughters' generation, they have an attitude about race that's entirely different than even my generation."