The official UN tally showed 154 votes in favor, 3 against and 23 abstentions, though diplomats and UN officials said the actual vote was 155-3-22 due to Angola being recorded as having abstained and not voting yes. Venezuela, which said it had planned to abstain, Zimbabwe and three other countries were not allowed to vote because they were in arrears on their UN dues.
UN Secretary-General Ban Ki-moon welcomed the vote, saying the treaty "will make it more difficult for deadly weapons to be diverted into the illicit market and ... will help to keep warlords, pirates, terrorists, criminals and their like from acquiring deadly arms."
Iran, Syria and North Korea last week prevented a treaty-drafting conference at UN headquarters from reaching the required consensus to adopt the treaty. That left delegations that support it no choice but to turn to a General Assembly vote to adopt it.
The Iranian, Syrian and North Korean delegations cast the sole votes against the treaty on Tuesday.
Iran, which is under a UN arms embargo over its nuclear program, is eager to ensure its arms imports and exports are not curtailed, while Syria's government is embroiled in a two-year civil war and relies on arms from Russia and Iran, envoys said.
North Korea is also under a UN arms embargo due to its nuclear weapons and missile programs.
The treaty will be open for signature on June 3 and will enter into force 90 days after the 50th signatory ratifies it. Mexican UN Ambassador Luis Alfonso de Alba told reporters it normally takes two to three years for a treaty to come into force, but said he hoped it would happen sooner in this case.
Major arms producers China and Russia joined Cuba, Bolivia, Nicaragua and other countries in abstaining.
Russia taking a hard look
A number of countries, led by India, which also abstained, complained the treaty favored exporting over importing states. Russia said Moscow would take a hard look at the treaty before deciding whether to sign it.
Several delegates told Reuters the treaty's effectiveness would be limited if major arms exporters refuse to sign it.
The United States, the world's No. 1 arms exporter, voted in favor of the treaty despite fierce opposition from the National Rifle Association (NRA), a powerful US pro-gun lobbying group.
US Secretary of State John Kerry said in a statement the UN adopted "a strong, effective and implementable Arms Trade Treaty that can strengthen global security while protecting the sovereign right of states to conduct legitimate arms trade."
"Nothing in this treaty could ever infringe on the rights of American citizens under our domestic law or the Constitution, including the Second Amendment," he added, referring to the U.S. constitutional amendment that guarantees the right to bear arms.
The NRA opposes the treaty and has vowed to fight to prevent its ratification by the US Senate when it reaches Washington. The NRA says the treaty will undermine domestic gun rights, a view the US government has strongly rejected.
Syrian UN Ambassador Bashar Ja'afari repeated that his government opposes the arms trade treaty because it does not ban the sale of weapons to non-state actors and "terrorists" like those it says are active in Syria. The civil war there has claimed at least 70,000 lives, according to UN estimates.
Syria routinely refers to rebels trying to oust President Bashar al-Assad as "terrorists" backed by foreign governments.
The treaty does not ban transfers to armed groups, but says all arms transfers should be subjected to rigorous risk and human rights assessments first.
British Prime Minister David Cameron hailed the vote as a "landmark agreement that will save lives and ease the immense human suffering caused by armed conflict around the world."
Scrutiny on human rights
Mexico issued a statement on behalf of 98 U.N. member states saying, "an effective implementation of this treaty will make a real difference for the people of the world."
UN member states began meeting on March 18 in a final push to end years of discussions and hammer out a binding international treaty to end the lack of regulation over cross-border conventional arms sales.
Arms control activists and rights groups have said a treaty was needed to halt the uncontrolled flow of arms and ammunition that they say fuels wars, atrocities and rights abuses.
The Arms Trade Treaty aims to set standards for all cross-border transfers of conventional weapons. It would also create binding requirements for states to review all cross-border arms contracts to ensure that arms will not be used in human rights abuses, terrorism or violations of humanitarian law.
"The agreement of the Arms Trade Treaty sends a clear message to arms dealers who supply warlords and dictators that their time is up," said Anna Macdonald of the global development group Oxfam.
Amnesty International's Frank Jannuzi said the NRA, which claimed credit last year for persuading the United States to block the treaty in July 2012, failed this time.
"Iran, Syria and North Korea blocked consensus at the UN, while the NRA cynically, and ultimately unsuccessfully, tried to erode the US government's support through a campaign of lies about the treaty," Jannuzi said.
The main reason the arms trade talks took place at all is that the United States, the world's biggest arms trader, reversed US policy on the issue after President Barack Obama was first elected and decided in 2009 to support a treaty.