Berlin - An 11th-hour deal clinched by German Chancellor Angela Merkel to rescue her fragile government by limiting migrant arrivals immediately ran into European resistance Tuesday, with neighbouring Austria vowing to "protect" its borders.

In high-stakes crisis talks overnight, Merkel put to rest for now a dangerous row with a longtime rival, Interior Minister Horst Seehofer, that had threatened the survival of her shaky 100-day-old coalition.

Looking relieved, Merkel - who has been in power since 2005 - hailed a "very good compromise" that would "control" new arrivals of migrants and asylum seekers while upholding EU cooperation and values.

However, criticism from Vienna and her junior coalition partners, the Social Democrats (SPD), threatened to throw a spanner in the works.

If the agreement reached is approved by the German government as a whole, "we will be obliged to take measures to avoid disadvantages for Austria and its people," Vienna's rightwing government warned.

And it would be "ready to take measures to protect our southern borders in particular," it said referring to the frontiers with Italy and Slovenia. Foreign Minister Karin Kneissl expressed anger Vienna "was not consulted", in remarks quoted by Austrian media.

The Austrian reaction raised the spectre of a domino effect in Europe, with member states taking increasingly restrictive measures to shut out refugees.

"If Austria wants to introduce controls at the border, then that is its right," Italy's far-right Interior Minister Matteo Salvini said.  "We will do the same thing and we'll come out ahead because there are more people arriving here."

Under the pact both sides hailed as a victory, Merkel and Seehofer agreed to tighten border controls and set up closed "transit centres" on the Austrian frontier to allow the speedy processing of asylum seekers and the repatriation of those rejected.

They would either be sent back to EU countries that previously registered them or, in case arrival countries reject this, be sent back to Austria, pending a now questionable agreement with Vienna.

CSU general secretary Markus Blume called the hardening policy proposal the last building block "in a turn-around on asylum policy" after a mass influx brought over one million migrants and refugees.

The number of new arrivals has fallen dramatically over the last several months. The accord covers about one-quarter of them, with 18,000 already-registered people crossing the Germany border between January and May this year.

But doubts were voiced quickly by other parties and groups, accusing Merkel of turning her back on the welcoming stance she showed toward asylum seekers at the height of the influx in 2015.

Refugee support group Pro Asyl slammed what it labelled "detention centres in no-man's land" and charged that German power politics were being played out "on the backs of those in need of protection".

Annalena Baerbock of the opposition Greens party spoke of "internment camps", accusing the conservatives of "bidding goodbye to our country's moral compass".  She urged Merkel's other coalition ally, the Social Democrats (SPD), to reject the plan.

SPD leader Andrea Nahles said the party still had "significant questions" on the deal. The Social Democrats are to hold joint party meeting with the CDU/CSU bloc at 1600 GMT Tuesday.

One of the SPD's migration experts, Aziz Bozkurt, was withering, charging that the proposed holding centres would be "impractical and fully on track with the AfD" - the far-right party that has been most outspoken against immigrants.

The deal drew a line under Merkel's worst crisis as she faced down an unprecedented mutiny by Seehofer, head of her party's traditional Bavarian allies the CSU. She expressed hope to CDU-CSU deputies Tuesday that "we can return to a calm way of working in other aspects of politics", news agency DPA reported. But top-circulation Bild daily predicted further turbulence ahead. "It's possible that this solution will work," it said. "But it's certain that the mood in a coalition has never been as toxic as in this one."

Judy Dempsey of think-tank Carnegie Europe said Merkel, Europe's longest-serving leader, and the EU were left weakened by the pact in Berlin at a time of bigger global crises. This "couldn't come at a worse time for a European Union that on the one hand is saddled with several populist/nationalist governments and on the other is having its very existence being questioned by US President Donald Trump," she said.

Austria vows to 'protect' its borders after German deal

Austria's government warned Tuesday it could "take measures to protect" its borders after Germany planned restrictions on the entry of migrants as part of a deal to avert a political crisis in Berlin.

If the agreement reached Monday evening is approved by the German government as a whole, "we will be obliged to take measures to avoid disadvantages for Austria and its people," Vienna's rightwing government said in a statement. It added it would be "ready to take measures to protect our southern borders in particular," those with Italy and Slovenia.

"We expect more clarity" from Berlin, Austrian Chancellor Sebastian Kurz said Tuesday at the European Parliament in Strasbourg, where he presented his country's priorities as it takes over the rotating EU presidency for the next six months.

Late on Monday, German Chancellor Angela Merkel reached a deal on migration with her rebellious interior minister, Horst Seehofer, to defuse a bitter row that had threatened her government.

Among the proposals is a plan to send back to Austria asylum seekers arriving in Germany who cannot be returned to their countries of entry into the European Union.

But Kurz warned "other countries, like Austria, will react by national measures" if Berlin confirms it will turn away asylum seekers arriving at the German border if they were registered elsewhere.

Austria said it would be prepared to take similar measures to block asylum seekers at its southern borders, with the risk of a domino effect in Europe.

"I would like to make a promise to you: the Austrian presidency will do everything possible so that in the long term we have a Europe without internal borders again," Kurz told MEPs.

But that would be dependent on guaranteeing sufficient protection for the EU's external borders, he said.

"On the other hand, I cannot promise you when that might happen, I cannot predict whether there will be national measures" of the type announced by Germany against "secondary movements" of migrants within the EU.

The Austrian chancellor welcomed the "important turning point" reached by the EU, with the priority now on the need to tackle arrivals on European coasts.

There is no longer a focus just on "the distribution" of asylum seekers within the EU, but also on the protection of borders, he said.