LONDON (Reuters) - Britain could have to wait a decade for a free trade deal with the United States if it votes to leave the European Union, U.S. President Barack Obama said on Sunday in his final salvo of a disputed foray into British domestic politics.

U.S. President Barack Obama boards Marine One as he departs Winfield House in London, Britain April 24, 2016. REUTERS/Kevin Lamarque

Obama has spent the last three days in London urging Britons to stay in the EU as the British public prepares to vote on whether to remain a member of the bloc on June 23. He played on the two countries’ close historic ties to warn that from a U.S. perspective, leaving the EU would be a mistake.

“It could be five years from now, 10 years from now before we’re actually able to get something done,” Obama told the BBC when asked about the prospect of a post-Brexit trade deal.

That added to his warning on Friday that Britain would find itself at “the back of the queue” for a new trade deal with the United States if it departed the EU.

Obama’s decision to intervene in the EU debate has angered the eurosceptic “Out” campaign, which has argued that Britain could easily negotiate international deals and get better terms outside the 28-nation EU.

His high-profile warning built on other recent major interventions highlighting the negative economic impact of an exit, with polls showing largely deadlocked public opinion may be starting to shift in favor of the “In” campaign.

Obama’s image, one of the most recognizable in global politics, was quickly added to pro-EU campaign posts online under the slogan “Obama thinks the UK is Stronger In Europe”.

Hillary Clinton, a fellow U.S. Democrat and the frontrunner to become the party’s candidate to succeed Obama as president, also wants Britain to stay inside the EU, her campaign team said on Saturday.

London Mayor Boris Johnson, de facto head of the “Out” campaign, heavily criticized Obama’s comments on trade.

“It is ridiculous to warn that the UK will be at the back of the queue for a free trade deal,” he told the Mail on Sunday newspaper. “The UK has never been able to do a free trade deal with the US in the last 43 years – because we are in the EU!”

Answering such criticism, Obama said that his involvement had been justified because of the two countries’ longstanding special relationship, and that he hoped he had been able to persuade some British voters.

“The UK would not be able to negotiate something with the United States faster than the EU,” he said. “We wouldn’t abandon our efforts to negotiate a trade deal with our largest trading partner, the European market.”

He said he hoped to conclude talks on the Transatlantic Trade and Investment Partnership between the EU and the United States by the end of his term, although he said it might not be ratified by the U.S. Congress before he leaves office.

Slideshow ( 3 images )

Obama left Britain on Sunday bound for Germany, where he will hold talks with German Chancellor Angela Merkel, one of his closest allies in dealing with a shaky global economy and security crises in the Middle East and Ukraine.

LAST NINE MONTHS

Obama also said he hoped his final months in the White House would see the influence of Islamic State militants in Iraq and Syria reduced. “I do think that we can slowly shrink the environment in which they operate and take on strongholds like Mosul and Raqqa that is the beating heart of their movement.”

However, he dismissed the prospect of sending ground troops into the region to oust Syrian President Bashar al-Assad.

“It would be a mistake for the United States, or Great Britain, or a combination of Western states, to send in ground troops and overthrow the Assad regime,” he said.

But the United States and others should use their international influence to persuade Assad allies, such as Russia and Iran, to broker a political transition, he said.

Obama further said the successful creation of a global health security infrastructure that can be used to tackle the threat of diseases such as Ebola and Zika, and putting into effect climate change goals agreed in Paris, were important goals for the last leg of his presidency.

“I’m a busy guy,” he said. “This whole myth of a lame duck so far hasn’t proved to be the case ...I won’t get everything done that I want to get done, but I’ll get a whole bunch done that makes these next nine months worthwhile.”