PETISOVCI, Slovenia — 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 – further 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 further 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 uncoordinated 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 U.N. refugee agency said Slovenia has the capacity to accept some 7,000 migrants a day. Slovenian officials said, however, that 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 2 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.”

Slovenia, the country of some 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 them 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.”

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

Croatian Interior Minister Ranko Ostojic said Hungary’s decision won’t stop the flow of hundreds of thousands of migrants from the Middle East, Asia and Africa who have been surging into Europe.

“Nobody can stop this flow without shooting,” Ostojic said, adding that further closure of frontiers for migrants would cause “a domino effect and lot of troubles for all countries” that are on the migrant route.

Hungary’s right-leaning government 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.

Over 383,000 migrants have entered Hungary this year, nearly all passing through on their way to Germany and other destinations further 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.