U.S. President Barack Obama (R) and Britain's Prime Minister David Cameron shake hands during a bilateral meeting at the summit of G7 nations at Schloss Elmau on June 7, 2015. Photo by Carl Court/Getty Images Barack Obama has warned that Britain will lose influence if it leaves the European Union.

In an interview with the BBC broadcast on Thursday night, the US president said the EU “made the world safer and more prosperous” and confirmed Washington’s longstanding view that Britain should remain a member.

Rather than avoiding taking a stance on the issue, which will be the subject of a referendum in Britain – probably next year, he said: “Having the UK in the EU gives us much greater confidence about the strength of the transatlantic union, and is part of the cornerstone of the institutions built after [the second world war] that has made the world safer and more prosperous. We want to make sure that the United Kingdom continues to have that influence.”

Obama’s comments will be welcome in Downing Street, where David Cameron intends to lead the referendum campaign for Britain to remain in the EU following his renegotiation of the terms of membership.

Although Cameron has not ruled out recommending withdrawal in the event of his renegotiation failing, the prospect of his not eventually committing himself to continued EU membership seems extremely remote.

Pro-Europeans argue that leaving the EU would diminish Britain’s international influence, and Obama’s comments will help them to make that case.

In his interview, Obama said that Britain was the US’s “best partner” because of its willingness to project power beyond its “immediate self-interests to make this a more orderly, safer world”.

A Number 10 source said: “It’s right for Britain to have this renegotiation and this referendum to address the concerns that the British people have about Europe and to make sure the British people have the final say about whether we stay in a reformed European Union or leave.”

But the Eurosceptic Conservative MEP Daniel Hannan posted a message on Twitter saying: “I accept that there may be some arguments for Britain staying in the EU. Humouring Barack Obama is not one of them.”

And the Ukip MEP Patrick O’Flynn said Obama was unwise to pressure Britain to stay in the EU for the US’s convenience. “We need to look to our own national interest first,” he said.

Britain's Prime Minister David Cameron wipes his eye as he addresses a news conference during a European Union leaders summit in Brussels March 20, 2015. REUTERS/Francois Lenoir

Obama also welcomed Cameron’s commitment to continue meeting the Nato target of spending 2% on defence. He said: “We don’t have a more important partner than Great Britain. For him to make that commitment when he has a budget agenda that is confined, a budget envelope that is confined, is significant.”

The US administration has previously expressed concerns about the UK’s commitment to military spending and had pressed for Mr Cameron to commit to the target.

In June, US defence secretary Ashton Carter said the UK had always “punched above its weight” militarily and it would be “a great loss to the world” if it cut defence spending in a way that suggested it was “disengaged”.

John Redwood, the Eurosceptic Conservative MP, said Obama was wrong about the benefits to the UK of being in the EU.

“If letting foreign countries impose laws on you, levy taxes on you, and spend your money is such a good idea why doesn’t he create an American Union so Mexico can have common borders with the US, Cuba can spend US tax on herself, and Brazil can impose laws on the US the US does not want,” Redwood said.

“If he did that to the US and it worked then he would be in a stronger moral position to lecture us on having common borders with Eastern Europe, having Greece spending our money and having laws the Germans want but we don’t.”

But Lucy Thomas, campaign Director of Business for New Europe, said: “President Obama’s comments underline the essential strategic importance of the UK’s place in Europe: it is because of our membership that we are valued as such an important ally. The president’s carefully considered words show once again what is at stake in this referendum campaign.”

This article was written by Andrew Sparrow from The Guardian and was legally licensed through the NewsCred publisher network.