Germany has reintroduced border controls with Austria, its interior minister has confirmed, halting all trains and deploying 2,100 riot police to help carry out checks.
Speaking at a press conference called at short notice, Thomas de Maizière said the controls were being applied with immediate effect "to bring some order to the entry of refugees".
While the exact nature of the checks remained unclear, the minister described them as a "safety measure" which was within the remit of the Schengen Agreement.
"In Germany the rules will be applied in order to protect refugees," De Maizière said. "Germany has shown a lot of willingness to help, there have been many helpers and volunteers, but this helpfulness must not be overstretched."
A spokesperson for an Austrian rail company said German officials had begun halting all trains trying to cross the border into Bavaria from 5pm local time (4pm BST), while the situation involving traffic going the other way remained unclear.
Reporting on the unexpected move earlier and citing unnamed officials, German daily Bild said the closing of the border represented "a dramatic shift in refugee policy".
Der Spiegel reported that only those with "valid travel documents" would be allowed to enter the country from Austria "until further notice".
Tens of thousands of refugees have been arriving in southern Germany in recent weeks, with some reports suggesting around 13,000 reached Munich on Saturday alone.
According to Bild, the central government was sending 21 riot police squadrons, each of 100 officers, to help secure the border, after local officials issued a plea for more help from the federal force.
Kronen Zeitung, an Austrian daily, reported that there were concerns in Vienna of a backlog as people were subjected to additional checks to "determine immediately who is entitled to asylum".
It quoted unnamed government officials, who said: "Angela Merkel has assured Chancellor Werner Faymann in a telephone conversation that there will be no chaos."
Thomas Stobl, a senior member of Ms Merkel's Christian Democrats party (CDU), told Die Welt that he welcomed the return of controls.
"The controls that have been introduced on the border with Austria are the right thing to do," he said. "They'll enable us to at least slow down the acute inflows of refugees."
At the press conference, said that the focus for border controls would "initially" be on the border with Austria, suggesting they could be extended if necessary.
"This measure is also a signal to all of Europe," he said. "Germany is taking on its responsibility but, given the burden, there must be a fair distribution across Europe.
"The border controls will not solve everything, we are aware of that, but we have to apply this in order to get some order.
"And we also need to prevent more refugees from coming to Europe from Syria, Iraq and other countries."
He said the matter had been agreed by all coalition parties in Germany, and added that he had personally been in contact with the Austrian government.
Austrian officials said around 6,000 refugees had entered the country since midnight and that it was on course for a record 10,000 for the day, with the vast majority heading for the German border.
A spokesman for the Austrian police force said: "The flow of refugees remains very high."
Munich's mayor, Dieter Reiter, said earlier on Sunday that the city had reached its "upper limit" of capacity for housing refugees.
He said Munich was short around by around "1,000 to 5,000" spaces, adding that while the city was serious about welcoming those in need, it had reached the end of its limited resources.
Also on Sunday, Austrian police said they had rescued 42 people, including five women and eight children, who were found in a refrigerated truck at a rest stop near the border with Germany.
Police said all were in good health and that two Iraqi men suspected of people smuggling were arrested. Last month, 71 people were found dead after they suffocated inside a truck on a highway in Austria.
Join our commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies