All the G7 nations have agreed at their summit in Canada on the importance of a “rules-based trading system”, despite tensions with the US.
The joint statement signed by US President Donald Trump and his counterparts comes amid a row over high US tariffs imposed this month on steel and aluminium imports.
The EU and Canada have taken steps to retaliate.
Mr Trump says tariffs are needed to reverse America’s trade deficit.
Soon after the joint statement was announced, the US president tweeted defiantly about not allowing “other countries to impose massive tariffs and trade barriers on its on farmers, workers and companies”.
The G7 summit, held in La Malbaie, Quebec province, also covered such issues as relations with Russia.
What was agreed?
In the communique announced by Canadian Prime Minister Justin Trudeau, the group of major industrial nations – Canada, the US, the UK, France, Italy, Japan and Germany – agreed on the need for “free, fair, and mutually beneficial trade” and the importance of fighting protectionism.
“We strive to reduce tariff barriers, non-tariff barriers and subsidies,” they said.
When asked about President Trump’s earlier comments on trade, in which he warned his allies off imposing retaliatory measures for the tariffs, Mr Trudeau told reporters: “The president will continue to say what he says at various occasions.”
He continued: “What we did this weekend was come together and roll up our sleeves and figure out consensus language that we could all agree to on a broad range of issues.”
What else did Trump have to say?
President Trump earlier told reporters he had proposed the idea of a tariff-free G7 to other leaders and described his talks with them as “extremely productive”.
“The United States has been taken advantage of for decades and decades,” he continued, describing America as a “piggy bank that everyone keeps robbing”.
President Trump said retaliation tariffs from his allies were a “mistake” and warned that if it got as far as a trade war, then the US would “win that war a thousand times out of a thousand”.
He left the summit early to travel to Singapore for a landmark meeting with the North Korean leader Kim Jong-un to try to persuade him to give up the country’s nuclear weapons.
What are the tariffs?
On 1 June, the US imposed a 25% tariff for steel and 10% for aluminium on imports from the EU, Canada, and Mexico. Mr Trump said the move would protect domestic producers that were vital to US security.
The EU then announced tariffs on US goods ranging from Harley-Davidson motorcycles to bourbon. Canada and Mexico are also taking action in retaliation.
Jessica Murphy, BBC News, Quebec
The US president has made it clear he believes the removal of tariffs against his G7 allies should come at a price – and he doesn’t expect the US to pick up the tab.
His statements on the sidelines of the contentious G7 summit come just weeks after his administration slapped metals tariffs on Canada, the EU and Mexico, who quickly announced their own retaliatory measures.
Sticking points also remain in the North American Free Trade Agreement (Nafta) renegotiations between Canada, the US and Mexico, despite it being a key topic during the bilateral meeting between Mr Trump and Canadian PM Justin Trudeau.
The American leader said a three-country deal would only be possible with substantial changes, and reiterated his interest instead in forming separate two-way trade accords with Mexico and Canada – an interest Canada has made clear it does not share.
While the consensus-based G7 might well agree on the benefits of both free and fair trade between economic allies, it appears what that could look like it still up for debate.
What is the G7?
It is an annual summit bringing together Canada, the US, the UK, France, Italy, Japan and Germany, which represent more than 60% of global net worth between them.
Economics tops the agenda, although the meetings now always branch off to cover major global issues.
Russia was suspended from the group in 2014 because of its annexation of Crimea from Ukraine. On Friday, Mr Trump made a surprise call for Moscow to be readmitted, but German Chancellor Angela Merkel said other members were against the idea.