But Justice Minister and Vote Leave spokesman Dominic Raab immediately hit back at Mr Obama.
He said: 'The President made clear that uncontrolled immigration into the EU is a threat to national security. I agree - that is why it is safer to take back control so that we can stop terror suspects from Europe coming into the UK.
'He argued that he thinks it is in America's interests for the UK to stay in the EU but what is good for US politicians is not necessarily good for the British people.
'We want more international cooperation after we Vote Leave, but the EU is not fit for purpose, and cannot cope with the multiple crises we face like terrorism, Syria and mass migration.
'The US would not dream of opening its border with Mexico, so it is hypocritical for President Obama to insist that we do the same with Europe.'