London: Britain's ability to fight terrorism would be "more effective" with its European allies, US President Barack Obama has said. Writing in the Daily Telegraph Obama, who is on a three-day visit to Britain, said being inside the EU magnifies Britain's influence across the world, BBC reported. But writing in the Sun, Vote Leave's Boris Johnson said Obama's view was "a breathtaking example of the principle do-as-I-say-but-not-as-I-do". The president's intervention in Britain's forthcoming EU referendum on June 23 has been hotly debated and sparked claims of "hypocrisy" from those who want to leave the EU. However, Obama recognised that ultimately the matter was for British voters to decide for themselves. He also said: "...the outcome of your decision is a matter of deep interest to the US." "The tens of thousands of Americans who rest in Europe's cemeteries are a silent testament to just how intertwined our prosperity and security truly are," he reminded the nayers. "And the path you choose now will echo in the prospects of today's generation of Americans as well," he told the voters. Obama said the US' relationship with Britain "forged as we spilt blood together on the battlefield". "The European Union doesn't moderate British influence -- it magnifies it. A strong Europe is not a threat to Britain's global leadership; it enhances Britain's global leadership," he said. Obama said Britain had benefitted from being inside the EU in terms of jobs, trade and financial growth. "This kind of cooperation -- from intelligence sharing and counter-terrorism to forging agreements to create jobs and economic growth -- will be far more effective if it extends across Europe. Now is a time for friends and allies to stick together," he wrote. Johnson described Obama's argument as "inconsistent" and "downright hypocritical". "The Americans would never contemplate anything like the EU for themselves or for their neighbours in their own hemisphere. Why should they think it right for us?" Johnson described as "nonsense" the notion that Britain has more influence inside the EU than outside. "The UK has been outvoted 40 times in Brussels in the last five years, and the total bill for those defeats -- in extra costs for the government and business -- is put at 2.4 billion pounds a year," Johnson wrote. Tory MP Iain Duncan Smith, who is also part of the 'Vote Leave' campaign, also accused Obama of double standards. "I can imagine no circumstances under which he would lobby for the US Supreme Court to be bound by the judgments of a foreign court," he said. "Nor can I imagine any circumstances in which he would accept that laws should be made for -- or taxes imposed on -- the people of the US without the approval of Congress." Obama's stay in Britain is part of a tour which also includes a visit to Germany and Saudi Arabia -- from where he arrived late Thursday after holding discussions with King Salman on issues including Iran, Syria, Yemen and the fight against Islamic State militant group. The president and First Lady Michelle Obama are due to have lunch with the Queen at Windsor on Friday, and dinner with the Duke and Duchess of Cambridge. Obama will also speak at a news conference with British Prime Minister David Cameron.