German Chancellor Angela Merkel defended a United Nations agreement on migration in a passionate speech to parliament on Wednesday, accusing its opponents of "nationalism in its purest form."

The UN pact, to regulate the treatment of migrants worldwide, was approved in July by all 193 member states except the United States and is to be signed in Morocco next month.

But Australia on Wednesday said it would not sign up to the pact, joining nations including Israel, Hungary and Austria who have said it would compromise immigration policy.

In an appeal to embrace a multilateral approach to the migrant issue, Merkel made a thinly veiled attack on U.S. President Donald Trump and her far-right opponents at home.

"There are people who say they can solve everything themselves and don't have to think about anyone else, that is nationalism in its purest form," she told the Bundestag lower house of parliament in an unusually passionate address.

Merkel, whose 13-year chancellorship has been marked by her open-door migrant policy, said the UN pact was in Germany's interests and would not infringe on national sovereignty.

The Global Compact for Safe, Orderly and Regular Migration is a framework for co-operation and aims to reduce illegal migration, help integrate migrants and return them to their home countries. It asks backers to use detention only as a last resort. Impetus for the pact followed Europe's biggest influx of refugees and migrants since World War Two.

Some of Merkel's conservatives, notably Health Minister Jens Spahn who is standing to succeed her as head of the Christian Democrat party (CDU), have called for a broader debate before Germany signs up to the pact. Far-right Alternative for Germany (AfD) lawmakers oppose it.

"This pact for migration, like the refugee pact, is the right attempt to find solutions for global problems internationally, together," Merkel said to heckles from the AfD.

She said in 2015 Germany realized that the problem of flight and migration had to be tackled at an international level, that "no one country can do it alone."

"The debate about a global pact for migration, for orderly, legal migration in a world where there are 222 violent conflicts ... 68.5 million refugees, 52 per cent of whom are children, this organization plays a central role," she said.

Pact 'would compromise Australia's interest'

In Australia, newly installed prime minister Scott Morrison said the UN agreement 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 centres 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 for their conditions.

"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.

In this July 17, 2018, photo provided by Aziz Abdul, a man walks past the East Lorengau Refugee Transit Center on Manus Island, Papua New Guinea. Hundreds of asylum seekers seeking to arrive to Australia by boat are housed in camps in Papua New Guinea and Nauru that have given rise to criticism by human rights activists due to their conditiosn. (Aziz Abdul via AP)

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.

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 favour with many voters — Australia is due to hold an election in 2019 — critics argued such a policy could lead to labour shortages.

The Swiss government said Wednesday the country won't attend the UN conference next month because it wants to wait for parliamentary debates at home before giving its final blessing.

Switzerland's governing Federal Council said in October it planned to adopt the Global Compact for Safe, Orderly and Regular Migration, but would put it to parliament or consultation as required by law.

The Federal Council reiterated that it believes the pact is "consistent with Switzerland's interests."

The conference will be held in Marrakech, Morocco on Dec. 10-11.