More than 120 countries have approved the first treaty to ban nuclear weapons - but the UN meeting was boycotted by all nuclear-armed nations.
To loud applause and cheers, Elayne Whyte Gomez, president of the UN conference that has been negotiating the legally binding treaty, announced the results of the "historic" vote - 122 nations in favour, the Netherlands opposed and Singapore abstaining.
"The world has been waiting for this legal norm for 70 years," since the use of the first atomic bombs on Hiroshima and Nagasaki in August 1945 at the end of the Second World War, she said.
The treaty is "the first multilateral nuclear disarmament treaty to be concluded in more than 20 years", Ms Whyte Gomez said.
It will be opened for signatures in September and come into force when 50 countries have ratified it, she said.
In December, UN member states overwhelmingly approved a resolution calling for negotiations on a treaty that would outlaw nuclear weapons, despite strong opposition from nuclear-armed nations and their allies who refused to participate.
Ms Whyte Gomez said 129 countries signed up to take part in drafting the treaty, which represents two-thirds of the 193 member states. But all nuclear states and Nato members boycotted the negotiations except for the Netherlands, which has US nuclear weapons on its territory and was urged by its parliament to send a delegation to the negotiations.
The treaty requires all ratifying countries "never under any circumstances to develop, test, produce, manufacture, otherwise acquire, possess or stockpile nuclear weapons or other nuclear explosive devices".
It also bans any transfer or use of nuclear weapons or nuclear explosive devices - and the threat to use such weapons.
Retired British Royal Navy Commander Rob Green, who flew nuclear strike aircraft and is now co-director of the Peace Foundation's Disarmament and Security Centre, said earlier this week that "the heart of this treaty" is the prohibition on threatening to use nuclear weapons.
Richard Moyes, managing director of Article 36, a British-based organisation that works to prevent harm from nuclear and other weapons, said it is not plausible to think the world can maintain security based on mutually threatening to incinerate hundreds of thousands of people with nuclear weapons "when we know there have been near-misses, errors of judgment - there's been accidents - and there's a degree of instability in the political leadership in the world".
None of the nine countries known or believed to possess nuclear weapons - the United States, Russia, Britain, China, France, India, Pakistan, North Korea and Israel - is supporting the treaty.
The US and other nuclear powers instead want to strengthen and reaffirm the near half-century-old Nuclear Nonproliferation Treaty, considered the cornerstone of global nonproliferation efforts.
That pact sought to prevent the spread of atomic arms beyond the five original weapons powers - the US, Russia, Britain, France and China.
It requires non-nuclear signatory nations to not pursue atomic weapons in exchange for a commitment by the five powers to move towards nuclear disarmament and to guarantee non-nuclear states access to peaceful nuclear technology for producing energy.
North Korea's nuclear and ballistic missile tests, including its July 3 launch, have become a timely argument for proponents and opponents of the treaty to ban atomic weapons.