Former U.S. Ambassador to the U.N. Nikki Haley, in her newly released book, defended the Trump administration's decision to pull out of the United Nations' global migration pact -- arguing that it would have eliminated the distinction between legal and illegal immigration, and sharply questioning its focus on issues like climate change.

The U.S. withdrew from the drafting of the U.N.’s Global Compact for Safe, Orderly and Regular Migration in December 2017. The document, which was adopted by the global body a year later in Morocco, saw a host of other countries --including Hungary, Poland, Austria and Israel -- pull out of the compact amid concerns it would hurt nations’ ability to control their borders.

TILLERSON DENIES UNDERMINING TRUMP AFTER NIKKI HALEY ALLEGATIONS

The accord included 23 objectives for managing migration at "local, national, regional and global levels." But many of those aims are vague, including objectives like: "enhance availability and flexibility of pathways for regular migration" and "address and reduce vulnerabilities in migration."

Haley, in “With All Due Respect,” said that speculation that she was pressured into ending U.S. participation was “not true” and then went into detail about her objections to the internationalist document.

“The compact grew out of an international statement of principles on migration that had been championed by the Obama administration. The statement was a mess,” she said. "Like so much of our immigration debate today, it attempted to erase all distinctions between illegal and legal immigration.”

Haley, the daughter of legal immigrants from India, said that it also blurred the lines between economic or family-based migrants and refugees escaping persecution -- distinctions she argues are “critical.”

“If we no longer acknowledge a difference between legal and illegal immigration -- and between people who need international protection and those who just want to escape poverty or crime -- we will have a system of completely open immigration,” she wrote. “We will have effectively eliminated our borders. We can never do that.”

In the book, she said that while the document was nonbinding and largely symbolic, she first believed the U.S . could change the document's language and direction -- but as the debate went on, realized that wasn’t the case. Instead, she said, the document started turning toward focusing on issues like climate change.

“Give me a break,” she said. “Millions of people didn’t flee Syria because of climate change. They fled because chemical bombs were being dropped on their homes by a war-criminal dictator who was clinging to power.”

That remark comes just as 2020 presidential hopeful Bernie Sanders released his immigration plan, which calls for pathways to citizenship for those in the country illegally as well as the acceptance of a minimum of 50,000 “climate migrants” in the first year of a Sanders administration.

SANDERS IMMIGRATION PLAN: HALT DEPORTATIONS, ABOLISH ICE, WELCOME 50K 'CLIMATE MIGRANTS,' GIVE WELFARE TO ALL

Ultimately though, Haley said the “deal breaker” on the U.N. compact for the U.S. was that it called for migration and refugee policy to be governed by international law rather than individual countries.

“American decisions on immigration policies must always be made by Americans and Americans alone. Only we will decide how best to control our borders and who will be allowed to enter our country,” she said. “The Global Compact on Migration was headed toward creating an international right to migration, which does not exist in international law and is not compatible with U.S. sovereignty.”

CLICK HERE FOR THE FOX NEWS APP

Elsewhere in the book, Haley accused the left of trying to erase the difference between legal and illegal immigration, and pushing the message that those who want borders are cruel -- and calls it an example of “the divisive politics that is poisoning our public debate.”

“What those pushing this argument don’t realize or don’t want to acknowledge is that this kind of polarizing, us-versus-them politics actually hurts those immigrants who want to come to America, work hard, respect our laws, and embrace our principles,” she wrote. “Equating support for immigration with open borders only causes people to oppose immigration."