TOVARNIK, Croatia (CNN) Angry Hungarian officials have accused Croatia of helping refugees from the Middle East cross its borders illegally.
A train carrying 1,000 migrants and 40 Croatian police officers crossed into Hungary on Friday without permission, according to Hungarian government spokesman Zoltan Kovacs.
"This is a violation of the international law and this act is considered completely illegal," Kovacs said.
The train was seized at a railway station six kilometers inside of Hungary, and Croatian police officers on board the train were disarmed, he said. The officers were sent back to Croatia, and the train driver was taken into custody. Hungary will take care of the migrants and provide them shelter, food and medical assistance, Kovacs said.
UN: Time running out
Meanwhile, the United Nations Refugee Agency warned Friday that time is running out for Europe to resolve the refugee crisis.
Europe needs a coherent and unified response to the problem, said UNHCR spokesman Adrian Edwards.
"With more than 442,440 refugees and migrants having arrived via the Mediterranean so far this year, some 2,921 deaths, and 4,000 people arriving on the Greek islands daily, the crisis is growing and being pushed from one country to another without solution," Edwards said. "This environment is fertile ground for people-smugglers and others seeking to prey on this vulnerable population."
Croatian police said Friday that more than 14,000 migrants had entered the country since borders were opened. But the U.N. refugee agency said Croatia was only prepared to handle 500 migrants a day.
Kovacs had harsh words for the Croatian government's immigration strategy. At an impromptu press conference on the Hungary-Croatia border, the spokesman said Croatia's plans "collapsed within one day." And on Twitter, he accused Croatia of lying and breaking "all relating EU regulations."
Earlier this week, Croatia had welcomed migrants. But as the trickle of people became a rush of migrants crossing the country's borders, things changed. On Thursday, Croatia closed seven of its border crossings with Serbia.
With an official response that has included razor wire, tear gas and water cannons, Hungary has gotten a reputation as one of the most heavy-handed some say cruel European countries dealing with the ongoing influx of migrants and refugees.
But Kovacs defended his country's tactics. At his press conference Friday, he insisted Hungary would follow European Union protocols.
The country also announced that it was extending a state of emergency prompted by the migrant crisis, and that it would construct a temporary security fence along its border with Austria and Croatia over the weekend.
Throughout Europe, migrants are increasingly getting the cold shoulder, as borders close.
Nevertheless, the human stream keeps coming into Europe from Syria, Iraq and Afghanistan, where armed conflict has pushed millions from their homes, and also from Turkey, Jordan and Lebanon, where refugee camps are overflowing and the World Food Program has cut food rations for lack of funding.
They are looking for pathways to Germany.
Rivers, mountains, landmines
The route that runs through Austria and Croatia looks short on a map, but it is arduous, leading over rivers and mountains, and old battle lines of the Balkan Wars in the 1990s, where leftover scattered landmines and other unexploded ordnance lurk beneath the brush.
The path leads through Slovenia, which, like Hungary, is a European Union border frontier. And it seems resistant to letting migrants pass through.
Austria has reinstated border control measures on its border to Slovenia.
Germany's new barriers
Even if the migrants make it to Germany, which let in tens of thousands of people early on, they could encounter closed borders. Lawmakers there are working to make it easier to quickly deport those who don't achieve refugee status, German public television broadcaster ARD has reported. They are also looking to cut the level of aid provided to refugees in Germany.
Aid workers say Europe is facing its largest refugee and migrant crisis since World War II.
The EU is still trying to figure out how to distribute 160,000 migrants and whether to set quotas for member countries to absorb them.
Eastern European countries in particular have shown resistance to committing to a quota.
Switzerland, however, said Friday that it would take 1,500 refugees registered in Italy and Greece if the EU can decide on an overall relocation program.
CNN's Ivan Watson reported from Tovarnik, while Tomas Etzler and Ben Wedeman reported from the Hungarian-Serbian border. CNN's Kimberly Hutcherson wrote from Atlanta. Hamdi Alkhshali contributed to this report.