There were 154 votes in favor, 3 against and 23 abstentions.
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 the General Assembly to adopt it.