Barack Obama warned Britain on Friday against leaving the European Union, undercutting a key argument of eurosceptics by saying London would be "at the back of the queue" for a post-Brexit trade deal.
The US president's comments on Britain's June 23 EU membership referendum at a press conference with UK Prime Minister David Cameron drew a furious reaction from those campaigning to leave the 28-country bloc.
Standing alongside Cameron at the Foreign Office in London, Obama said Britain was "at its best when it is helping to lead a strong Europe".
The US president, whose term ends next January, made an unusually detailed and heartfelt intervention in the politics of another country and repeatedly spoke of the "special relationship" between Britain and the United States.
But his most significant remarks came on trade, reflecting growing concern in Washington at the prospect of Britain leaving the EU.
Asked what would happen if Britain did vote to quit, Obama said that while "maybe at some point" it could seal a trade deal with the United States, "it's not going to happen any time soon".
"The UK's going to be at the back of the queue," Obama added.
Obama also told German newspaper Bild ahead of a visit to the country this weekend he believed the proposed Trans-Atlantic Trade and Investment Partnership (TTIP) would strengthen trade and create jobs in the US and the EU.
Opponents of the deal plan a demonstration Saturday in Hanover.
Anti-EU campaigners in Britain, like London Mayor Boris Johnson, have made the claim the country could sign free trade deals with global allies a key plank of their campaign.
Nigel Farage, leader of the eurosceptic UK Independence Party, dismissed the president's comments.
"President Obama won't be in office by the time we're out of the EU post-referendum," he wrote on Twitter. "Trade deal of course in both countries' interests."
For his part, Cameron restated his case for Britain remaining in the EU, a close fight which will define his political legacy.
"Now I think is a time to stay true to our values and stick together with our friends and allies," he said.
Obama's comments fuelled a controversy ignited earlier Friday by an article he wrote in The Daily Telegraph newspaper at the start of his four-day visit.
The president argued that Britain's place in the EU magnified its global influence.
"The outcome of your decision is a matter of deep interest to the United States," he wrote.
Johnson, the leading face of the eurosceptic campaign, said it was "downright hypocritical" of Obama to intervene as the United States would not accept the same limits on its own sovereignty as EU members do.
"For the United States to tell us in the UK that we must surrender control of so much of our democracy is a breathtaking example of the principle of do as I say, not as I do," Johnson wrote in The Sun tabloid.
Ahead of the press conference, Obama and First Lady Michelle Obama had lunch at Windsor Castle with Queen Elizabeth II, who turned 90 on Thursday, and her husband Prince Philip.
They later had dinner with the monarch's grandson Prince William, his wife Kate and brother Prince Harry.
William and Kate's two-year-old son Prince George, third in line to the throne, stayed up past his bedtime to meet the Obamas.
George, who was dressed for bed in his pyjamas and a white dressing gown, played on a rocking horse they gave him when he was born.
Richard Whitman, professor of politics and international relations at the University of Kent, said Obama was "making a very strong appeal from the heart" in his remarks on Brexit.
"It will be difficult to say from the polls whether his intervention made a significant difference but I think that it creates a narrative which appears to be favouring the 'Remain' campaign," he said.
A Sky News television survey found 57 percent said Obama's intervention would make "no difference" to their vote.
While experts warn many people have not yet decided how to vote, the "Remain" camp currently has 54 percent support compared to 46 percent for "Leave", according to an average of the last six opinion polls calculated by the What UK Thinks project.