Croatia has said it can no longer offer refuge to the large numbers of migrants arriving in the country and will move them onwards, challenging the EU to find a policy to receive them.

The migrants, mostly from poor or war-torn countries in the Middle East, Africa and Asia, have streamed into Croatia since Wednesday, after Hungary blocked what had been the main route with a metal fence and riot police at its border with Serbia.

"We cannot register and accommodate these people any longer," Croatian Prime Minister Zoran Milanovic told a news conference in the capital Zagreb.

"They will get food, water and medical help, and then they can move on. The European Union must know that Croatia will not become a migrant 'hotspot'. We have hearts, but we also have heads."

The arrival of 17,000 since Wednesday morning, many crossing fields and some dodging police, has proved too much for one of the EU's less prosperous states.

The crisis has divided the 28-nation bloc and left it scrambling to respond.

A record 473,887 refugees and migrants have crossed the Mediterranean to Europe so far this year, the International Organization for Migration said, most of them from countries at war such as Syria who are seeking a better, safer life.

Hundreds of thousands have been trekking across the Balkan peninsula to reach the richer European countries north and west, especially Germany, which is preparing to process 800,000 asylum seekers this year.

But that has wrongfooted the European Union, which has come up with no common policy to deal with the biggest wave of migration to Western Europe since World War II.

Hungary acted on its own to shut the main route this week by closing its border with Serbia, leaving thousands of migrants scattered across the Balkans searching for alternative paths.

Croatia, offering one of the few overland routes to Germany that would bypass Hungary, found itself suddenly overwhelmed.

Despite Hungary's hardline stance, it did take in at least 1,000 migrants today from Croatia.

Ferried to the border in buses and by train, they were watched by police and soldiers as they were transferred onto other buses across the border in Hungary, where police said they would be registered.

While Zagreb made welcoming statements earlier this week, Mr Milanovic said he had called a session of Croatia's National Security Council and that it was time to deal with the problem differently.

The president has told the military to be ready if called on to help stop the flow of people.

Croatia, the EU's newest member state, has already closed almost all roads from the border.

Interior Minister Ranko Ostojic said if the crisis continued "it is a matter of time" before the border was shut completely, though Milanovic, in his remarks, questioned whether even that would keep migrants out.

Police have rounded up many migrants at the Tovarnik railway station on the Croatian side of the border with Serbia, where several thousand spent the night under open skies.

Some kept travelling and reached tiny EU member Slovenia overnight.

Many did so by evading the police and trekking through fields or travelling by train, exasperated by Europe's confused response to the crisis.

Worried by the situation, Slovenia stopped all rail trafficon the main line from Croatia. Late tonight, Prime Minister Miro Cerar - reversing his earlier stance - said Slovenia might consider forming a "corridor" for migrants to pass via its territory to western Europe "if the pressure is too great".

Unlike Croatia, Slovenia is a member of Europe's Schengen zone of border-free travel, an important goal for refugees.

With around 1,000 migrants expected to enter Slovenia in the next 24 hours, it has said it plans to abide by EU rules by receiving asylum requests but returning illegal migrants.

After failing to agree on a plan to distribute 160,000 refugees across the EU - just a fraction of the numbersarriving this year - the bloc has called a summit for next Wednesday to work on a united response.