Boris Johnson faced embarrassment on Friday as Barack Obama coolly dismissed the Mayor of London’s suggestion that the “part-Kenyan” US president holds an “ancestral dislike” of Britain and its former empire.

Standing alongside David Cameron, as he delivered a ringing endorsement of Britain remaining in the European Union, Mr Obama directly addressed Mr Johnson’s claim, in a newspaper article, that he may have removed a bust of Winston Churchill from the Oval Office because of a grudge against Britain, expressing his “love” for the wartime leader and revealing saying that a bust of Churchill was situated outside his private office.

Mr Johnson’s comments attracted a hail of criticism, with senior Labour figures accusing the figurehead of the Brexit campaign of “dog whistle racism” and a return to the language of the “nasty party”.

But the row was overshadowed by a stark warning from the US president that Britain’s role in the world could be diminished by leaving the EU, and that it would have to wait many years for its own trade deal with the United States.

"The United States wants a strong United Kingdom as a partner and the United Kingdom is at its best when it is helping to lead a strong Europe," he said. "It leverages UK power to be part of the European Union. I don't believe the EU moderates British influence in the world, it magnifies it."

Speaking after meeting the Queen and the Duke of Edinburgh at Windsor Castle, he said that while said nothing could affect the “emotional, cultural and intellectual affinities” between Britain and the US, Brexit would have a dramatic impact on the trade relationship between the two countries.

What's the European Parliament ever done for us? Show all 5 1 /5 What's the European Parliament ever done for us? What's the European Parliament ever done for us? A cap on the amount of hours an employer can make you work The Working Time directive provides legal standards to ensure the health and safety of employees in Europe. Among the many rules are a working week of a maximum 48 hours, including overtime, a daily rest period of 11 hours in every 24, a break if a person works for six hours or more, and one day off in every seven. It also includes provisions for paid annual leave of at least four weeks every year Getty Images What's the European Parliament ever done for us? Helping the people of Britain to avoid smoking In 2014 MEPs passed the Tobacco Products Directive strengthening existing rules on the manufacture, production and presentation of tobacco products. This includes things like reduced branding, restrictions on products containing flavoured tobacco, health warnings on cigarette packets and provisions for e-cigarettes to ensure they are safe What's the European Parliament ever done for us? Helping you to make the right choices with your food Thanks to the European Parliament, UK consumers have access to more information than ever about their food and drink. This includes amount of fat, and how much of it is saturated, carbohydrates, sugars, protein and so on. It also includes portion sizes and guideline daily amount information so people can make informed choices about their diet. All facts must be clear and easy to understand What's the European Parliament ever done for us? Two year guarantees and 14-day returns policy for all products Consumers across the EU have access to a number of rights, from things which are potentially very useful, to things which used to be annoying. For example, shoppers in the UK receive a two-year guarantee on all products, and a 14-day period to change their minds and return a purchase, these things are useful www.PeopleImages.com-licence restrictions apply What's the European Parliament ever done for us? Keeping your air nice and fresh (and safe) Believe it or not, although the situation is improving, some areas of the UK have appalling air quality. A report by the Royal College of Physicians released on 23 February says 40,000 deaths are caused by outdoor air pollution in the UK every year. Air pollution is linked to a number of illnesses and conditions, from Asthma to diabetes and dementia. The report estimates the costs to British business and the health service add up to £20 billion every year

Responding to critics who said he had no right to intervene in the debate, he said that those arguing for Brexit should not be “afraid” to hear his arguments.

“My understanding is that some of the folks on the other side have been ascribing to the United States certain actions we’ll take if the UK does leave the EU,” he said. “They say for example, we’ll just cut our own trade deals with the United States. They’re voicing opinion about what the United States are going to do. I figured you might want to hear it from the President of the United States.

“I think it’s fair to say that maybe at some point down the line there might be a UK-US trade agreement – it’s not going to happen any time soon because our focus is on is in negotiating with a big bloc, the European Union, to get a trade agreement done. The UK is going to be in the back of the queue.”

Mr Obama’s visit was marked by protestations by Leave campaigners that he was acting hypocritically in recommending the UK continue to cede powers to Brussels in a way the US never would to another country.

In an article for The Sun newspaper, Boris Johnson said that for the US to tell Britain “we must surrender control of so much of our democracy” was a “breath-taking example of the principle of do as I say, not as I do.”

But the London Mayor’s suggestion that Mr Obama had removed a bust of Churchill from the Oval Office as a “snub to Britain”, and a “symbol of the part-Kenyan president’s ancestral dislike of the British Empire” drew severe criticism.

Obama tribute to the Queen

Downing Street said that Mr Johnson had his facts wrong, while Churchill’s grandson, the MP Sir Nicholas Soames, called the article “appalling”. Labour’s Shadow Chancellor John McDonnell said the comment was an example of “dog whistle racism” and called for it to be withdrawn.

Addressing the claim head-on, Mr Obama said he had a bust of Churchill outside his private office which he saw “every day”.

"It's there voluntarily because I can do anything on the second floor. I love the guy,” he said. Explaining his decision to remove the Oval Office bust, he said: "I thought it was appropriate - and I think most people in the United Kingdom might agree - that as the first African American president, it might be appropriate to have a bust of Dr Martin Luther King in my office to remind me of all the hard work of a lot of people who had somehow allowed me to have the privilege of holding this office," he said.

Addressing the UK’s choice in the EU referendum, the president said he was not in London to “fix any votes” but launched an impassioned defence of Britain’s role within the union.

"Precisely because I have a confidence in the UK, and I know that if we are not working effectively with Paris or Brussels then those [terror] attacks are going to migrate to the United States and to London, I want one of my strongest partners in that conversation,” he said.

"So it enhances the special relationship, it does not diminish it."

Mr Obama said that while the vote was a matter for the British people, the US had a "deep interest" in the outcome.

Last night leave campaigners renewed their attack on Mr Obama. The Ukip leader Nigel Farage said: “Last time we followed foreign policy advice from a US President was when we went to war in Iraq. We should be wary.”

The former Labour Foreign Secretary, Lord Owen, said the public would be puzzled that the President was arguing for Britain to stay in the “dysfunctional” bloc, particularly as the eurozone faced “impending collapse”.