The prime minister of New Zealand has said Britain's position is stronger if it remains in the European Union
At a meeting with David Cameron, John Key said: "If we had the equivalent of Europe on our doorstep ... we certainly wouldn't be looking to leave it."
Mr Cameron described the comments as "important". New Zealand wants to sign a free trade deal with the EU.
The Vote Leave campaign said it was safer to take back control of UK trade deals from "bureaucratic Brussels".
Mr Key made his comments while meeting Mr Cameron at a nuclear security summit in Washington. He stressed that it was for the "British people to decide" on the outcome of the EU referendum on 23 June.
But he added: "We certainly think it's a stronger position for Britain to be in Europe."
He said New Zealand wanted a free trade agreement with Europe because of its "huge amount of middle income consumers".
Will Straw, executive director of the Britain Stronger in Europe campaign, said the remarks "underlined the vital importance to British consumers and businesses of the UK's access to Europe's single market, which is the best free trade deal available to the UK."
"Our membership of the EU gives us clout across the world," he said.
But Vote Leave chief executive Matthew Elliott said "Britain doesn't have a free trade deal with New Zealand - one of its closest allies - because we've handed control of trade policy to the EU.
"Even if the EU managed to eventually negotiate a deal with New Zealand, John Key has been clear that his country would keep the deal in place after we Vote Leave, torpedoing one of the Remain campaign's key scare stories. "
On Twitter, others questioned whether Mr Key was best placed to comment after backing ultimately unsuccessful efforts to change New Zealand's flag - which includes the Union Jack.
UKIP's communications chief Gawain Towler tweeted: "What is it with John Key - first he tries to change the NZ flag - loses, then says he would join the EU if he could!"