DONALD Trump has attacked the European Union, China other nations over trade, threatening to "take on" the bloc and superpower.

Addressing a rally in Michigan, the US president said the EU "sounds so nice" but it was "formed to take advantage of the United States".

The European Union was temporarily spared from a round of tariffs on metal imports imposed by Mr Trump's administration in March, although the exemption is due to expire in the coming days.

Pledging to support US farmers, Mr Trump accused Brussels of putting up barriers and called for markets to be opened up.

"When we take on China or the European Union, which has tremendous blocks, it's very hard for us to sell stuff into the European Union. It was put there to take advantage of the United States, OK."

Responding to a member of the crowd shouting "not anymore", he replied: "You're right. Not anymore. We told them that yesterday actually, we said the same words 'not anymore'. Those days are over.

"But we've got to open up these markets. It's not fair."

The US and China have been locked in a bitter dispute over tariffs on metals and other products, raising fears of a trade war between the world's two largest economies.

Meanwhile French president Emmanuel Macron and German chancellor Angela Merkel are reported to have urged Mr Trump to extend the EU's exemption from punishing tariffs on aluminium and steel during recent visits to Washington.

Bemoaning the US's deficit in international trade, Mr Trump told the rally: "Long-term you're going to be so happy... we're going to get it opened up or we're not doing business with these countries.

"With the European Union last year... that sounds so nice, doesn't it? I don't know why, they literally... formed to take advantage of the United States.

"And I don't blame them. You know what? I don't blame them, I don't blame (Chinese) president Xi (Jingping). I don't blame prime minister (Shinzo) Abe of Japan, I don't blame the heads of these countries for taking advantage of us.

"I blame past presidents and past leaders of our country."