Britain's membership of the European Union is "vital" for the security of the West, former Republican presidential candidate Senator John McCain has said.
Next month President Obama is expected to use a visit to London to urge British voters to vote to remain in the EU at the referendum.
MPs campaigning in favour of Brexit, including Boris Johnson, have demanded Obama stay out of the debate.
McCain, who lost the 2008 presidential election to Obama, made the intervention after meeting with the Commons defence committee on Thursday.
"The need for a strong and united Europe is greater than ever. The United States has long benefitted from British leadership in NATO and the EU – for instance, leading sanctions against Russia, providing vital support to Afghanistan and Ukraine, and grappling with the refugee crisis fueled by Vladimir Putin," he said.
"The United States and the United Kingdom are confronting the most diverse and complex array of crises since the end of World War II. To meet these challenges, we need a comprehensive response that makes the best use of our collective economic, political, and military power.
David Cameron welcomed the intervention by the veteran Republican senator.
McCain added: "Having a strong British voice in NATO and the EU helps ensure we make the most of the collective power of these institutions.
"British membership in the EU is a vital contributor to the security and prosperity of Europe and the United States."
McCain, the chairman of the US Senate Armed Services Committee, said whatever the outcome of the referendum it would "send a strong message to Vladimir Putin".
"This is a decision for the British people, but one with profound implications for our common security and our shared values," he said.
Despite McCain's intervention, Republican presidential candidate Ted Cruz told a campaign rally recently that Obama "will make it more likely that England will pull out of the EU" if he spoke out.
Earlier this week a cross-party group of MPs wrote to President Obama to urge him to stay silent. "This is a chance for the British people to choose the path of their country. Interfering in our debate over national sovereignty would be an unfortunate milestone at the end of your term as president," the MPs wrote.
Boris Johnson has also accused the president of “outrageous and exorbitant hypocrisy” for advising the UK to remain inside the EU when the US would never accept a similar arrangement with other countries.
Downing Street has defended the right of foreign leaders to voice their opinion.
And Obama’s spokesman has said the president would "continue to make clear" that the United States wanted to see the UK remain inside the EU.
The president will visit the UK at the end of April. In a statement, the White House said Obama will "offer his gratitude to the British Government and people for their stalwart partnership with his administration and the American people throughout his presidency".