Charlie Kupchan, Mr Obama's senior director for European Affairs, said the UK had played an "out-sized role" in the world and that "in today's world that kind of out-sized role is best achieved through clubs, through teamwork". He said for jobs and growth "we believe the UK will be better off in the European Union".

Mr Kupchan called the EU "one of the great accomplishments of the post World War II era".

He said: "We are concerned about the health and vitality of that experiment. In that respect we would not want to see a Brexit that could potentially damage the European Union."

Mr Obama will arrive in the UK from Saudi Arabia late on Thursday April 21. The following day he will have lunch with the Queen and meet David Cameron for a discussion that will include Isil and counter-terrorism.

On Saturday morning Mr Obama will take part in a town hall event where he will answer questions from young people and speak about the special relationship between the US and UK. He is expected to be asked about his views on the referendum at that event.

Mr Obama first interjected himself into the Brexit debate last July when he said: "Having the UK in the European Union gives us much greater confidence about the strength of the transatlantic union. We want to make sure that the United Kingdom continues to have that influence."