SERBIA and Croatia have agreed to ease the flow of migrants over the border between the countries after thousands of people, including children, were forced to spend the night out in the open in near-freezing temperatures along a muddy border passage.

The interior ministers of Serbia and Croatia said they will start moving migrants by train directly from Serbia to Croatia so that they will not have to cross on foot, often travelling miles in rain and cold weather.

Migrants will register when they enter Serbia and will be able to cross into Croatia without any delays, which should speed up the process significantly, ministers said.

“We have agreed to stop this torture,” said Croatian interior minister Ranko Ostojic. “There will be no more rain and snow, they will go directly from camp to camp.”

Further west, thousands of migrants aiming to reach northern Europe walked out of refugee camps on the border between Slovenia and Austria on their own, frustrated after waiting long hours in overcrowded facilities.

Eager to move on, thousands spread around along railway tracks, highways and mountain roads. Confused and unaware which roads to take to go west, some migrants later turned back and returned to the refugee camps to wait for bus transport to other locations.

Tensions have been building after the so-called Balkan route shifted. Migrants still cross first from Greece into Macedonia and then Serbia, but now go via Croatia and Slovenia instead of Hungary, which has erected fences along its borders with Serbia and Croatia.

Overwhelmed after nearly 50,000 migrants crossed in just a few days, tiny Slovenia said it has not ruled out erecting a fence of its own along parts of its 400-mile border with Croatia.

Prime minister Miro Cerar said yesterday that Slovenia will consider all options if left to cope on its own with the influx of thousands of people.

“Our sights are foremost on finding a European solution,” said Mr Cerar. “But should we lose hope for this ... all options are open within what is ­acceptable.”

The country of two million people already has deployed 650 army troops to help the police manage the flow and has asked the European Commission for an aid package, including €60 million in financial aid and police gear and personnel. Several EU nations have promised to send police officers to help Slovenia’s force.