Germany is to introduce temporary border checks with Austria in a bid to limit the influx of refugees.
The measure might lead to the disruption of railway services, interior minister Thomas de Maiziere said.
Germany and Austria agreed over a week ago to let in refugees who had gathered in Hungary, saying it was a one-time measure to ease an emergency.
Still, the influx has continued and German officials have said over the weekend that the speed of the arrivals was straining the country’s ability to provide accommodation.
Hungarian police said more than 186,000 people have passed through Hungary from Serbia this year en route to Austria and the migrants’ major destination, Germany, which said it has taken in more than 50,000 newcomers in the past week alone.
About 450,000 refugees have arrived in Germany this year. The country is expecting at least 800,000 in 2015 – by far the most in the 28-nation EU.
Earlier, at least 34 people seeking a better life in Europe drowned as they attempted a wind-swept crossing from Turkey to Greece, a journey often made more dangerous because smugglers require asylum seekers to pilot the overloaded craft themselves in choppy seas.
Greece’s coastguard said the dead, including four infants and 11 older children, drowned when their wooden boat containing more than 130 people capsized near Farmakonisi.
The island lies midway between Samos and Kos, two of the favoured targets for smugglers sending thousands daily to Greek islands off Turkey’s coast. Smugglers typically stay behind to avoid arrest in Greece.
Commenting on the move in Germany, Mr de Maiziere said: “This step has become necessary. The great readiness to help that Germany has shown in recent weeks ... must not be overstretched.”
Germany has called, so far with little success, for other countries in the European Union to share the burden of taking in people seeking refuge.
Its move came a day before a meeting of EU interior ministers, and Mr de Maiziere said it was “also a signal to Europe: Germany is facing up to its humanitarian responsibility, but the burdens connected with the large number of refugees must be distributed in solidarity within Europe”.
Mr De Maiziere did not specify how long the border controls would remain in place or give details of exactly how incoming migrants would be handled.
Germany’s national railway, Deutsche Bahn, said it had halted service between Austria and Germany for 12 hours at the authorities’ orders.
The rules of Europe’s passport-free travel zone, known as the Schengen area, allow countries to reintroduce controls in exceptional circumstances, and the European Commission said that “the current situation in Germany ... appears to be a situation covered by the rules”.