The U.N. General Assembly endorsed a sweeping accord to ensure safe and orderly migration Wednesday over opposition from five countries, including the United States and Hungary.

The Global Compact for Migration, the first international document dealing with the issue, is not legally binding.

It was approved by a vote of 152-5 with Israel, the Czech Republic and Poland also voting "no" and 12 countries abstaining. The vote in favor of the resolution was lower than the 164 countries that approved the agreement by acclamation at a conference in Marrakech, Morocco, earlier this month.

The compact represents a U.N.-led effort to crack down on the often dangerous and illegal movements of people across borders that have turned human smuggling into a worldwide industry, and to give people seeking economic opportunity a chance.

U.N. Secretary-General Antonio Guterres told the Marrakech conference that "more than 60,000 migrants have died on the move since the year 2000."

"This is a source of collective shame," he said.

Guterres and other supporters of the compact contend that migrants contribute to the world economy, including by providing needed workers in aging rich countries and returning cash to their poorer home countries through remittances.

The United States and other opponents argue that the compact is attempting to "globalize" how migration is carried out at the expense of the sovereignty of individual countries. Supporters counter that the compact is non-binding and every country remains in charge of its borders and migration policy.

The drafting process for the global compact was launched after all 193 U.N. member states, including the United States under President Barack Obama, adopted a declaration in 2016 saying no country can manage international migration on its own and agreed to work on a pact.

But the United States under President Donald Trump pulled out a year ago, claiming that numerous provisions in the compact were "inconsistent with U.S. immigration and refugee policies."

After lengthy negotiations on the often contentious issue, 192 countries unanimously agreed on the 34-page compact in July — every member of the U.N. General Assembly except the United States, which boycotted the meeting.

But in recent months, opposition to the compact has grown, reflected in the lower number of countries approving the compact in Marrakech and voting "yes" on Wednesday.