obama
U.S. President Barrack Obama is reflected in a mirror as he takes part in a Town Hall meeting at Lindley Hall in London, April 23, 2016. REUTERS/Stefan Wermuth

A trade deal between Britain and the United States could take five to 10 years to negotiate if Britain votes to leave the European Union at a June 23 referendum, U.S. President Barack Obama told the BBC in an interview broadcast on Sunday.

"It could be five years from now, 10 years from now before we're actually able to get something done," Obama told the British broadcaster in an excerpt posted online.

Obama, who is in the last nine months of his presidential term, has spent the last three days in London urging Britons to remain part of the EU as a divided British public prepares to vote on whether to remain a member of the 28-country bloc.

He told the BBC that Britain would not get preferential treatment over the EU when it came to negotiating a new trade deal.

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

Obama's visit and decision to intervene in the EU debate has angered the Eurosceptic "Out" campaign, which has repeatedly argued that Britain could easily negotiate deals and get better terms outside the EU.