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".

However Canadian Prime Minister Justin Trudeau vowed to go ahead with retaliatory tariffs on the US after what he described as Mr Trump's "insulting" decision to invoke national security concerns to justify the levy on steel and aluminium.

"It would be with regret but it would be with absolute clarity and firmness that we move forward with retaliatory measures on 1 July," he said.

"Canadians are polite and reasonable but we will also not be pushed around," Mr Trudeau added.

The G7 summit, held in La Malbaie, Quebec province, also covered such issues as relations with Russia.

What was agreed?
"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," Mr Trudeau said.

In the communique, 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.

Other agreements reached include:

Russia: A joint demand that Moscow "cease with its destabilising behaviour". The leaders called on the Kremlin to stop with its attempts to "undermine democracy" and to withdraw its support for Syrian President Bashar al-Assad

Iran: A pledge to "permanently" ensure Tehran's nuclear programme remains peaceful. The group said they were committed to ensuring Iran would "never seek, develop or acquire a nuclear weapon"

Climate: An agreement to disagree. The US refused to sign a pledge to implement the Paris climate change accord after Mr Trump announced he was pulling out of the agreement last June in the hope of a new "fair" deal

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.

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.