SYDNEY (Reuters) - Australia will not sign up to a United Nations migration agreement because it would compromise its hardline immigration policy and endanger national security, Prime Minister Scott Morrison said on Wednesday.

Prime Minister of Australia Scott Morrison reacts during the APEC CEO Summit 2018 at the Port Moresby, Papua New Guinea, 17 November 2018. Fazry Ismail/Pool via REUTERS

Australia joins the United States, Israel and several Eastern European countries in rejecting the U.N. Global Compact for Migration, which asks signatories not to detain would-be migrants arbitrarily and to use detention only as a last resort.

Morrison said that would jeopardize national security.

“The global compact on migration would compromise Australia’s interest,” Morrison told 2GB Radio. “It doesn’t distinguish between those who illegally enter Australia and those who come the right way.”

Under Canberra’s tough immigration policy, which has bipartisan support, asylum seekers arriving by boat are told they will never be allowed to settle in Australia.

They are then detained in two detention centers on remote South Pacific islands until they are accepted by another nation or agree to return home. The camps have been widely criticized by the United Nations and human rights groups.

“Australia is a textbook case of how not to treat boat arrivals, by sending them offshore to endure abysmal conditions for years and trying to shirk its international responsibilities onto less-developed countries,” said Elaine Pearson, Human Rights Watch’s Australia director.

Australia’s rejection of the U.N. pact is the latest move to tighten migration through a series of policies that are likely to form a central element of Morrison’s bid for re-election at a national ballot that must be held by May 2019.

Opinion polls indicate his conservative government is on course for a landslide defeat.

Australia has an annual immigration cap of 190,000 places. Morrison said this week his government would likely reduce that threshold, a policy that is popular with voters.

A Fairfax-Ipsos poll published on Monday found 45 percent of voters wanted immigration reduced, while a little more than 20 percent wanted an increase.

Morrison’s government said in October it would restrict new immigrants from living in Australia’s largest cities - Sydney, Melbourne and Brisbane - for up to five years.

Although likely to win favor with voters, critics argued such a policy could lead to labor shortages.

Australia’s central bank governor said in August an influx of new residents had helped to underpin strong economic growth.