President Donald Trump told world leaders the U.S. would no longer be 'taken advantage of' as he blasted trade deals that he says caused millions of jobs to vanish.

In a speech where he also called for collective action against 'Rocket man' Korean leader Kim Jong-un, Trump saluted the United States for having prevailed in World War II only to build 'institutions such as this one to defend the sovereignty, security, and prosperity for all.'

But the president wasn't so sanguine about the international trade regime also put in place after the second world war. He blasted 'mammoth, multinational trade deals' and 'unaccountable international tribunals' that govern them.

'The United States will forever be a great friend to the world and especially to its allies,' the president said.

President Donald Trump Donald Trump told the UN General Assembly the U.S. can 'no longer be taken advantage of' in trade

Scroll down for video

'But we can no longer be taken advantage of or enter into a one-sided deal where the United States gets nothing in return.'

'As long as I hold this office,' Trump vowed: 'I will defend America's interests above all else, but in fulfilling our obligations to our nations, we also realize that it's in everyone's interests to seek the future where all nations can be sovereign, prosperous, and secure.'

Trump included the famous 'America First' phrase in his speech. It is one he used during the campaign, despite its negative association with nationalist movements earlier in the nation's history.

'As president of the United States, I will always put America first. Just like you, as the leaders of your countries, will always and should always put your countries first,' Trump said, earning some applause from some audience members at the 193-nation gathering.

Trump reinforced his 'America First' message after his UN speech

NEW YORK, NY - SEPTEMBER 19: President Donald Trump speaks to world leaders at the 72nd United Nations (UN) General Assembly at UN headquarters in New York on September 19, 2017 in New York City

To reinforce the point, Trump tweeted after his speech: 'As President of the United States of America, I will ALWAYS put #AmericaFirst #UNGA,' the abbreviation for the UN General Assembly.

Trump's concerns about the bad trade deals in place didn't keep him from touting the U.S. economy under the status quo, with NAFTA and other trade deals still in place.

'The United States has done very well since Election Day last November 8,' Trumps said.

'In foreign affairs, we are renewing this founding principle of sovereignty',' the president said. 'Our government's first duty is to its people, to our citizens, to serve their needs, to ensure their safety, to preserve their rights, and to defend their values.'

Panamax ship, reaching Colon to pass the Canal, Atlantic Ocean,Panama Canal, Panama, Central America, Latin America. Trump said the U.S. would no longer accept 'one-sided' trade deals

Containers of Sinseondae Pier in Busan

Stephen Miller, senior advisor for policy to US President Donald Trump's is seen in a hallway at the United Nations as President Donald J. Trump addresses the audience during the opening of the General Debate of the 72nd United Nations General Assembly at at UN headquarters in New York, New York, USA, 19 September 2017

Trump blasted 'mammoth, multinational trade deals' of the kind the U.S. negotiated in past decades

Trump blasted those who would trade with North Korea, following a tightening of sanctions thanks to a UN Security Council resolution.

'In America, we seek stronger ties of business and trade with all nations of goodwill, but this trade must be fair and it must be reciprocal,' Trump said.

'For too long the American people were told that mammoth, multinational trade deals, unaccountable international tribunals, and powerful global bureaucracies were the best way to promote their success,' Trump said.

'But as those promises flowed, millions of jobs vanished and thousands of factories disappeared. Others gamed the system and broke the rules, and our great middle class, once the bedrock of American prosperity, was forgotten and left behind, but they are forgotten no more and they will never be forgotten again,' he said.