Thousands of migrants are crossing into Slovenia from Croatia after Hungary closed its border to them.
Around 2,700 arrived in Slovenia on Saturday and more were expected overnight. Most aim to travel on to Austria, Germany and other countries.
Slovenia's army has been placed on standby to help police deal with the influx, Prime Minister Miro Cerar said.
He said Slovenia would accept the migrants as long as Austria and Germany kept their borders open.
Hungary said it closed its border with Croatia at midnight on Friday because European Union leaders had failed to agree a plan to stem the flow of asylum seekers.
Last month it also shut its frontier with Serbia, which was another transit route to Western Europe.
On Saturday, hundreds of refugees were bussed across Croatia, from its border with Serbia to its border with Slovenia.
Many had spent weeks walking through Greece, Macedonia and Serbia to reach the Croatian border.
Slovenian authorities registered them and then arranged transport to the Austrian frontier.
Slovenia's official STA news agency later some of the migrants had already reached the Austrian border and were being registered at the Spielfeld crossing.
A spokeswoman for the UN refugee agency (UNHCR) said most of the migrants crossing Slovenia were from Syria, Iraq and Afghanistan.
"They are fleeing from war... they are literally running for their lives," Caroline van Buren told AFP news agency at the Petisovci checkpoint.
"Unlike other countries, Slovenia had time to prepare. It's not perfect, but things are moving."
A train carrying about 1,200 migrants arrived at the Sredisce ob Dravi crossing, AFP reported.
Meanwhile, two buses carrying mostly families with small children and babies arrived at the Gruskovje crossing where they were given medical help, food and warm clothes.
Can deeds match words?: The challenges ahead for the EU and Turkey
The pull of Europe: Five migrant stories
Merkel under pressure: Chancellor's migrant policy faces criticism at home
Focus on Turkey: Why the EU views Syria's northern neighbour as key
Crisis in graphics: Migration numbers explained
"We are going to focus even more on safety and security and order so our country can function normally,'' Prime Minister Cerar said.
Croatia is a member of the EU but, unlike Hungary and Slovenia, it is not part of the Schengen zone of passport-free travel.
However, Hungarian Foreign Minister Peter Szijjarto said border controls with Slovenia would also be temporarily reinstated to safeguard Hungary from a "mass wave of unidentified, uncontrolled migrants".
German Chancellor Angela Merkel is to travel to Turkey on Sunday for talks on the migrant crisis with President Recep Tayyip Erdogan.
Tens of thousands of migrants are arriving in the EU from Turkey, risking a sometimes perilous sea crossing to the Greek islands.
On Saturday, 12 refugees - four of them children - drowned while trying to reach the Greek island of Lesbos, the Turkish coastguard said. They were thought to be from Syria or Afghanistan.