Barack Obama will offer his “very candid view as a friend” that he believes the UK ought to remain as a member of the EU when he visits Britain next week.

In perhaps the clearest explanation yet of the US’s position on the controversy over whether or not Britain should remain in the community, senior US officials said Mr Obama believed it was up to the citizens of Britain to make the decision.

However, they said that Mr Obama believed it was in Britain’s best interests - and therefore also good for the US - that its close ally remain an integral part of Europe.

The Prime Minister has been leading the campaign to remain in the EU (PA)

“He will offer his view if he is asked his view,” Ben Rhodes, Mr Obama’s deputy National Security Advisor, told reporters on Thursday.

“He will make it clear it is a decision for the people of the UK to make, not ours. I am sure he will have plenty of opportunities to be asked this question. He will be very candid as friend that it is important for the UK to remain in the EU.”

Mr Obama will visit the UK on April 21-24, where he will have lunch with the Queen, before holding a bi-lateral meeting with David Cameron, who is leading the “in” campaign.

The US president will also take part in a so-called town hall with young people, one of a number of events where he might be asked about his views.

Mr Rhodes said the US believed that it was in its own interests for Britain to be economically strong and part of a powerful European bloc. “The UK is a key partner,” he said, saying that the UK had played a unique role around the world.

“If he is asked his views as a friend, he will offer it,” he said. “But he will make it clear that it is something for the British people to decide.”

London Mayor Boris Johnson, who is campaigning for the “Out” side, has railed against the “outrageous and exorbitant hypocrisy” of Mr Obama's visit.