LONDON — President Obama on Friday bluntly urged Britain to vote to remain inside the European Union in a referendum scheduled for June 23, and warned that a Britain outside the bloc could not count on maintaining its current economic relationship with the United States.

Taking an unusually direct position on another country’s internal politics, Mr. Obama asserted that Britain’s membership in the bloc did not limit British influence but “magnifies it.”

Speaking alongside Prime Minister David Cameron at a news conference, he also directly addressed the potential consequences of a vote by Britain to leave. The president said that to do so would send Britain to the “back of the queue” for a trade deal with the United States, challenging those who have argued that Britain could quickly replicate the same favorable terms it enjoys as a European Union member.

Mr. Cameron is leading the campaign to remain part of Europe, but the issue has deeply divided his Conservative Party and polls suggest that the outcome could be close, making the forcefulness of Mr. Obama’s statements especially striking.