US President Donald Trump and European leaders have pulled back from the brink of a trade war over cars and agreed to open talks to tear down trade barriers between America and the EU.

But the agreement was vague and the coming negotiations look certain to be contentious.

Meanwhile, the US remains embroiled in major trade disputes with China and other trading partners.

European Commission president Jean-Claude Juncker made a hastily called Rose Garden appearance with Mr Trump after the talks.

He said the US and the EU have agreed to hold off on new tariffs, suggesting that the US will suspend plans to start taxing European auto imports - a move that would have marked a major escalation in trade tensions between the allies.

Mr Trump also said the EU had agreed to buy "a lot of soybeans" and increase its imports of liquefied natural gas from the US. And the two agreed to resolve a dispute over US tariffs on steel and aluminium.

"It's encouraging that they're talking about freer trade rather than trade barriers and an escalating tariff war," said Rufus Yerxa, president of the National Foreign Trade Council and a former US trade official.

But he said reaching a detailed trade agreement with the EU would probably prove difficult.

The tone was friendlier than it has been. During a recent European trip, Mr Trump referred to the EU as a "foe" over "what they do to us in trade".

Mr Juncker, after Mr Trump imposed tariffs on steel and aluminium imports, said in March that "this is basically a stupid process, the fact that we have to do this. But we have to do it. We can also do stupid".

On Wednesday, Mr Trump and Mr Juncker said they have agreed to work towards "zero tariffs" and "zero subsidies" on non-automotive goods.

Mr Trump told reporters it was a "very big day for free and fair trade" and later tweeted a photo of himself and Mr Juncker in an embrace.

"Obviously the European Union, as represented by @JunckerEU and the United States, as represented by yours truly, love each other!" he wrote.

The president campaigned on a vow to get tough on trading partners he accuses of taking advantage of bad trade deals to run up huge trade surpluses with the US.

He has slapped taxes on imported steel and aluminium, saying they pose a threat to US national security.

The US and EU are now working to resolve their differences over steel and aluminium - but the tariffs are still in place.

And they would continue to hit US trading partners such as Canada, Mexico and Japan even if the US and the EU cut a deal.

Whatever progress was achieved on Wednesday could provide some relief for US carmakers.

The escalating trade war and tariffs on steel and aluminium had put pressure on car company earnings. General Motors had slashed its outlook, and shares of Ford and auto parts companies had fallen.