Updated

Hungary’s populist government announced this week that it is withdrawing from a U.N. global compact on migration, describing the agreement as “in conflict with common sense” and national security -- making it the second country after the U.S. to reject the compact.

“The primary issue for us is the security of Hungary and the Hungarian people, and this document is totally at odds with the country’s security interests,” Hungarian Foreign Minister Peter Szijjártó said in Budapest on Wednesday. “According to the Government’s position, the U.N. Global Compact for Migration is in conflict with common sense and also with the intent to restore European security.”

The agreement, officially called the “Global Compact for Safe, Orderly and Regular Migration,” was finalized Friday and was an effort to find an agreement that covered migration “in a holistic and comprehensive manner.”

“Migration raises profound issues: around state sovereignty and human rights; around what constitutes voluntary movement; the relationship between development and mobility; and how to support social cohesion.” U.N. Deputy Secretary-General Amina Mohammed said Friday.

“This compact demonstrates the potential of multilateralism: our ability to come together on issues that demand global collaboration -- however complicated and contentious they may be,” she added. The agreement is expected to be adopted by members states at an intergovernmental migration conference in Morocco in December.

The U.S. pulled out of talks in December, with then-Secretary of State Rex Tillerson arguing that it could undermine America's right to enforce its immigration laws and secure its borders.

“The United States supports international cooperation on migration issues, but it is the primary responsibility of sovereign states to help ensure that migration is safe, orderly, and legal,” Tillerson said.

Farhan Haq, spokesman for U.N. Secretary-General Antonio Guterres, said that all members are welcome to participate in the December conference.

"The Global Compact on Migration aims to provide Member States with a set of principles and values, grounded in international cooperation and respectful of national interests, to deal with international migration," he said.

Hungary’s decision is unlikely to surprise many observers. As with President Trump, Prime Minister Viktor Orban’s ruling Fidesz Party has made cracking down on mass migration a focus of its agenda, and comfortably won re-election in the country’s national elections in April campaigning on that very issue.

Trump spoke with Orban by phone last month, congratulating him on the formation of the new government and agreeing “on the need for strong national borders,” according to the White House.

Hungary was on the front lines of the 2015 migration crisis, and angered international groups by building a border fence and deploying troops to the border in the wake of the crisis. Orban’s government has been one of the leaders in a continentwide populist pushback against what it describes as “open border policies.”

On Wednesday, Szijjártó said that the document accepted as a fundamental premise the idea that migration is a good and unavoidable phenomenon.

“The Government regards this premise as unacceptable and regard migration as a bad process that has extremely serious security aspects,” he said. He also said the U.N. document defines migration as a human-rights issue, whereas Hungary regards it as a security issue instead.

HUNGARY'S PRO-TRUMP, POPULIST GOVERNMENT PUSHES SOROS CRACKDOWN

Hungary has doubled down on its pushback against mass migration since winning re-election in April. In June, the Hungarian Parliament passed legislation including a measure that makes it illegal for non-government organizations to organize illegal immigration into the country -- from financial support to the distribution of information.

The government has made it clear that the target of such legislation was left-wing Hungarian-American billionaire George Soros. Soros’ Open Society Foundations decried the measures as “unprecedented” and part of a “repressive political and legal environment” in the country.