Thousands of migrants surged into tiny Slovenia on Saturday as an alternative route opened in Europe for them after Hungary sealed its border for their free flow, adding another hurdle in their frantic flight from wars and poverty toward what they hope is a better life in Western Europe.

The closure of Hungary's border with Croatia early Saturday caused redirection of thousands of people — including women and small children soaked in cold rain — farther west toward Croatia's border with Slovenia.

The small European Union-member state has limited capacity to process large numbers wishing to head toward richer European Union countries such as Germany, Austria or Sweden.

This could leave thousands stranded in Croatia and farther east and south in Serbia and Macedonia — the countries on the so-called Balkan migrant corridor. The Hungarian border closure is the latest demonstration of EU's unco-ordinated response to the flow of people reaching its borders.

Several buses packed with migrants arrived in the Slovenian border town of Petisovci on Saturday from Croatia. A train carrying 1,800 people arrived to the border in the afternoon. Police said that after processing, most of them are transferred toward the Austrian border.

The UN refugee agency said Slovenia has the capacity to accept some 7,000 migrants a day. However, Slovenian officials said they can permit up to 2,500 people a day, and will allow in new groups only after previous groups leave the country.

Croatian police said more than 5,000 migrants have entered the country since Hungary closed its border, illustrating a possible backlog of those whom Slovenia would not admit.

UNHCR spokeswoman Caroline Van Buren said at Slovenia's border with Croatia Saturday that "all is going well" as the first groups of migrants started arriving to the small Alpine nation.

"We have been in cold since two in the morning in Serbia," said Omar Thaqfa, 33, from Mosul in Iraq. "We were sitting in the street. Very cold. Inshallah, I am going to Germany."

Border controls

Slovenia, the country of about 2 million people, has said it would beef up border controls and create entry points for migrants to manage the influx, but would keep accepting migrants as long as Austria and Germany kept their borders open. Croatia has said it will close its border with Serbia if Slovenia does the same with Croatia.

Slovenia's government has cleared the way for the armed forces to assist police in managing the influx. Officials said the army would provide logistical support to the police, but won't have any authority over migrants.

"We are going to focus even more on safety and security and order so our country can function normally," Slovenian Prime Minister Miro Cerar said, adding that Slovenia is a transit country for migrants and if "destination countries begin adopting stricter measures at the border, Slovenia will follow suit."​

EUROPE-MIGRANTS/HUNGARY

Migrants make their way after crossing the border at Zakany, Hungary on Friday. (Laszlo Balogh/Reuters)

Slovenia has said it would beef up border controls and create entry points for migrants to manage the influx, but would keep accepting migrants as long as Austria and Germany kept their borders open. Croatia has said it will close its border with Serbia if Slovenia does the same with Croatia.

Migrants had been coming through Croatia to get to Hungary and then further west. But Hungary blocked that route after midnight when police in full gear pulled a barbed-wire fence over a passage on the border with Croatia where some 140,000 migrants have passed since mid-September.

Hungarian Foreign Minister Peter Szijjarto announced the decision to close the border after a meeting of the national security cabinet on Friday.

"The Hungarian government has taken the steps ... to protect the internal European freedoms and the security of the citizens of Hungary and Europe," government spokesman Zoltan Kovacs said minutes after the shutdown.

Hungary decided to order the border clampdown after EU leaders who met Thursday in Brussels failed to agree on a plan backed by Hungary to send EU forces to block migrants from reaching Greece.

"We know that this is not the best, but only the second-best solution," Szijjarto said.

Normal checkpoints open

He said normal border checkpoints with Croatia would remain open, though inspections will be tightened. "We will introduce stricter controls to be able to block border crossings done illegally," Szijjarto said.

Although Croatia is also a member of the European Union, unlike Hungary it is not part of the Schengen zone of passport-free travel. Slovenia is in the Schengen zone.

More than 383,000 migrants fleeing war and poverty in the Middle East, Africa and Asia have entered Hungary this year, nearly all passing through on their way to Germany and other destinations farther west in the EU. The country clamped down on its border with Serbia with a similar razor wire fence on Sept. 15 and since then migrants have been taking a detour through Croatia to reach Hungary.

"We have every hope that the introduction of the border closure [with Croatia] will have the same positive effects as what we experienced on the border with Serbia," said Gyorgy Bakondi, senior adviser to Hungarian Prime Minister Viktor Orban.