The UK could take up to 10 years to negotiate trade deals with the United States if it leaves the European Union, President Barack Obama has warned.

Speaking on the future of trade, he said: “It could be five years from now, 10 years from now before we were able to actually get something done".

During a three-day trip to the UK, the US president has been condemned by Brexit-voters after telling Brits to vote to stay in the EU in the coming referendum.

At the end of his UK visit, Mr Obama said in an interview with the BBC: “We rely heavily on the UK as a partner globally on a whole range of issues; we’d like you having more influence.”

On the future of trade, however, he added that the UK “would not be able to negotiate something faster than the EU”.

Obama: Brexit would hurt Britain's trade with US

Arriving in Germany for the final few days of his European tour, President Obama was met by protestors demonstrating against a planned free trade agreement between the US and the EU.

An esimated 30,000 people attended a demonstration in Hannover the day before the US leader was due to arrive in the city to open the world's largest industrial trade fair.

The Trans-Atlanstic Trade and Investment Partnership (TTIP) has been opposed by environmentalists and consumer protection groups who say the deal would allow corporations to cut labour and erode environmental standards.

President Obama's comments on the EU referendum sparked further backlash from Leave campaigners this week, including London Mayor Boris Johnson who called President Obama “downright hypocritical”.

Mr Johnson said: “It is deeply anti-democratic - and much as I admire the United States, and much as I respect the president, I believe he must admit that his country would not dream of embroiling itself in anything of the kind.

“It is incoherent. It is inconsistent, and yes it is downright hypocritical. The Americans would never contemplate anything like the EU, for themselves or for their neighbours in their own hemisphere. Why should they think it right for us?”

The US president waded into the EU-debate earlier this week saying that Britain would be "at the back of the queue" following a potential separation from Brussels this year, with the European market currently the biggest trade market for the US.

Democratic presidential candidate Hilary Clinton has also voiced hopes for Britain to stay in the EU, saying she "values a strong British voice" in the union.

Ms Clinton’s senior policy adviser Jake Sullivan said: “Hilary Clinton believes that transatlantic co-operation is essential, and that co-operation is strongest when Europe is united."“

Vote Leave campaigners called Ms Clinton’s comments “hollow”, but a Downing Street source said “we should listen to our closest friends a allies”.

Labour MP Gisela Stuart, who co-chairs Vote Leave, said it was “extraordinary” that the US should urge Britain to remain part of a “dysfunctional organisation”.