United Nations (United States) (AFP) - With the North Korean nuclear crisis looming large, 51 countries on Wednesday lined up to sign a new treaty outlawing nuclear weapons that has been fiercely opposed by the United States and other nuclear powers.

The treaty was adopted by 122 countries at the United Nations in July following negotiations led by Austria, Brazil, Mexico, South Africa and New Zealand.

None of the nine countries that possess nuclear weapons -- the United States, Russia, Britain, China, France, India, Pakistan, North Korea and Israel -- took part in the negotiations.

NATO condemned the treaty, saying that it may in fact be counter-productive by creating divisions.

As leaders formally signed on the sidelines of the annual UN General Assembly, Secretary-General Antonio Guterres hailed as historic the first multilateral disarmament treaty in more than two decades.

But Guterres acknowledged that much work was needed to rid the world of its stockpile of 15,000 atomic warheads.

"Today we rightfully celebrate a milestone. Now we must continue along the hard road towards the elimination of nuclear arsenals," said Guterres.

The treaty will enter into force when 50 countries have signed and ratified it, a process that could take months or years.

"At a time when the world needs to remain united in the face of growing threats, in particular the grave threat posed by North Korea's nuclear program, the treaty fails to take into account these urgent security challenges," the 29-nation Western alliance said.

It added: "Seeking to ban nuclear weapons through a treaty that will not engage any state actually possessing nuclear weapons will not be effective, will not reduce nuclear arsenals, and will neither enhance any country's security, nor international peace and stability.

- Rejecting need for nuclear weapons -

Foreign Minister Sebastian Kurz of Austria, one of the few Western European nations that is not in NATO, rejected the idea that nuclear weapons were indispensable for security.

Story continues

"If you look at the world's current challenges, this narrative is not only false, it is dangerous," he told AFP.

"The new treaty on the prohibition on nuclear weapons provides a real alternative for security: a world without any nuclear weapons, where everyone is safer, where no one needs to possess these weapons," he said.

Brazilian President Michel Temer was the first to sign the treaty. Others included South African President Jacob Zuma and representatives from Indonesia, Ireland and Malaysia as well as the Palestinian Authority and the Vatican.

But even Japan, the only nation to have suffered atomic attack and a longstanding advocate of abolishing nuclear weapons, boycotted the treaty negotiations.

Japan is a top target of North Korea, which has triggered global alarm over its rapidly progressing drive to develop nuclear weapons, following its sixth and most powerful nuclear test and the firing of two intercontinental ballistic missiles.

The signing ceremony came a day after President Donald Trump threatened to "totally destroy North Korea" if the United States is forced to defend itself or its allies Japan and South Korea.

Nuclear powers argue their arsenals serve as a deterrent against a nuclear attack and say they remain committed to the nuclear Non-Proliferation Treaty.

That decades-old treaty seeks to prevent the spread of nuclear weapons. It recognizes the right of five nations -- Britain, China, France, Russia and the United States -- to maintain them, while encouraging them to reduce their stockpiles.