Australian, the US and much of Eastern Europe pulled out of the UN agreement on managing migrations because of concerns about border breaches.
A United Nations conference adopted a migration pact in front of leaders and representatives from over 160 countries in Morocco on Monday, despite a string of withdrawals driven by anti-immigrant populism.
The Global Compact for Safe, Orderly and Regular Migration - finalised at the UN in July after 18 months of talks - was formally approved with the bang of a gavel in Marrakesh at the start of a two-day conference.
But the United States and at least 16 other countries either opted out or expressed concerns, with some claiming the pact infringes national sovereignty.
Billed as the first international document on managing migration, it lays out 23 objectives to open up legal migration and discourage illegal border crossings, as the number of people on the move globally has surged to more than 250 million.
Describing it as a "roadmap to prevent suffering and chaos", UN Secretary General Antonio Guterres sought to dispel what he called a number of myths around the pact, including claims it will allow the UN to impose migration policies on member states.
The pact "is not legally binding", he said. "It is a framework for international cooperation."
"We must not succumb to fear and false narratives", he told an audience that included German Chancellor Angela Merkel, Panama's President Juan Carlos Varela, Greek premier Alexis Tsipras, Danish Prime Minister Lars Lokke Rasmussen and Spain's premier Pedro Sanchez.
Merkel launched an impassioned defence of the pact and multilateralism, saying her country "through Nazism brought incredible pain to humanity".
"The answer to pure nationalism was the foundation of the United Nations and the commitment to jointly searching for answers to our common problems," she said.
She insisted the pact seeks to prevent, rather than encourage, illegal migration. "This is about safe, orderly and regular migration - it says (this) clearly in the title."
On Friday, the US hit out at the pact, labelling it "an effort by the United Nations to advance global governance at the expense of the sovereign right of states".
It was the first country to disavow the negotiations late last year, while Australia, Austria, the Czech Republic, Dominican Republic, Hungary, Latvia, Poland and Slovakia have all pulled out of the process in recent months and weeks, before Chile withdrew overnight.
Rows over the accord have erupted in several European Union nations, hobbling Belgium's coalition government and pushing Slovakia's foreign minister to tender his resignation.
From the United States to Europe and beyond, right-wing and populist leaders have taken increasingly draconian measures to shut out migrants in recent years.
US President Donald Trump has pledged to build a wall on the US-Mexico border and has focused his recent ire on a migrant caravan from Central America, while a populist coalition government in Italy has clamped down on boats rescuing migrants at sea.
Belgium's liberal premier Charles Michel attended the conference after winning the support of parliament to back the accord, but was left leading a minority government after a Flemish nationalist party said it will quit his coalition over the pact.
"This model of cooperation is complex, sometimes including steps forwards and sometimes banana skins," Michel told delegates.
"But it is the only way forwards for those who want a better world".
The pact has been welcomed by the Catholic Church as an important step towards addressing migrants' needs and reducing their vulnerability.
"The Holy See is convinced that the enormous challenges that migration poses are best faced through multilateral processes rather than isolationist policies," said papal envoy Cardinal Piero Parolin.
Mexico, Guatemala, El Salvador and Honduras also welcomed the accord. These countries have worked on their own regional plan to manage migration, which EL Salvador's foreign minister Carlos Castaneda told reporters represents a first effort to work within the framework of the global compact.
'Should be ethically binding'
The UN's children's agency said the pact could help provide better access to education and health for migrant children and offer "them stronger protection from exploitation and violence".
Other organisations, including Amnesty International and the International Federation of the Red Cross, see the accord as just a first step towards protecting migrants.
"We have heard repeatedly that this compact is not legally binding and does not impact on state sovereignty," said IFRC president Francesco Rocca at a press conference on the sidelines of the main dialogue.
"But if we are serious about fixing this problem, it should at the very least be ethically binding."
In comments by a representative, Morocco's King Mohammed VI - absent from proceedings - said the pact offers a way forwards that navigates between the two extremes of closing borders and allowing uncontrolled migration.
After the Marrakesh conference, the UN General Assembly is set to adopt a resolution formally endorsing the deal on December 19.