David Miliband has accused Hungary and Croatia of engaging in an "arms race" that is "betraying European history" as tensions continue to rise over the refugee crisis.

Hungary accused its neighbour of committing a “major violation of international law” by allowing more than 1,000 refugees to take a train across its border, which was then halted as the 40 Croatian police on board were disarmed and returned, and the train driver arrested on Friday.

More than 17,000 migrants and asylum seekers entered Croatia in just three days this week after Hungary closed its border with Serbia, and families using the well-trodden Western Balkans route into the EU were forced to divert.

Border crossings have been shut, bridges blocked, trains stopped and barriers built as both countries attempt to stop the influx of people fleeing war and poverty in the Middle East and Africa.

Mr Miliband, the former Foreign Secretary, said: “The Syria crisis has already claimed 100s of thousands of victims.

“Now it is threatening one of the most important stabilizing institutions of the modern world: the European Union, which has helped bring peace and prosperity to 28 countries on the basis of shared values and commitments.

“A Europe defined by a beggar-my-neighbor race to the bottom was precisely what the EU was created to prevent.

“The arms race between Hungary and Croatia - from fences to water cannon to tear gas - to prevent refugees crossing their territory betrays European history, never mind European norms. The sooner that European leaders come together in the summit called by Germany the better."

The ex-Labour MP is President and CEO of the International Rescue Committee (IRC), which is working to help refugees and people affected by the crisis with healthcare, infrastructure and economic support.

Thousands of refugees are being trapped in a vicious tug-of-war between Balkan states, with those moving westwards after being beaten back tear gas and water cannon on the Hungarian-Serbian border meeting riot police in Croatia.

Meanwhile, neighbouring Slovenia stopped trains crossing the border was attempting to return refugees coming from Croatia.

Zoran Milanovic,, the Croatian Prime Minister, declared that his nation of 4.2 million could no longer cope as it started closing its border and trying to transfer people onwards into Hungary.

Refugees and migrants boarding a train in the Croatian town of Tovarnik, near the border with Serbia, on Friday night (AFP/Getty Images)

“You are welcome in Croatia and you can pass through Croatia,” he said. “But go on. Not because we don't like you, but because this is not your final destination.”

Only one woman with children has requested asylum in Croatia, which has one of the smallest economies in Europe.

It is part of the EU but not a party to the Schengen treaty, which allows people to travel freely between 26 European countries, but Slovenia and Hungary are members.

Relations between the former Yugoslav states continued to deteriorate on Saturday when Hungarian government spokesperson Zoltan Kovacs accused Croatia of committing a "major violation of international law" by allowing trains to cross its border.

Serbia's border with Croatia has become the latest flashpoint in Europe's refugee crisis (Getty/EPA)

"What we see today is a complete failure of the Croatian state to handle migration issues," he added.

"What is more, we see intentional participation in human smuggling, taking these migrants to the Hungarian border."

Croatia had said the two countries agreed to create a corridor for the refugees and the Hungarian foreign ministry called it a "pure lie".

The UN refugee agency warned the crisis was being worsened by the contradictory national policies.

How Hungary welcomes its refugees - in pictures Show all 15 1 /15 How Hungary welcomes its refugees - in pictures How Hungary welcomes its refugees - in pictures Serbia-Hungary border Refugees protest as Hungarian riot police fires tear gas and water cannon on the Serbian side of the border, near Roszke How Hungary welcomes its refugees - in pictures Serbia-Hungary border A refugee throws a bottle of water towards Hungarian riot police after they used water cannon to push back refugees at the Hungarian border with Serbia near the town of Horgos How Hungary welcomes its refugees - in pictures Serbia-Hungary border Refugees protest as Hungarian riot police fires tear gas and water cannon at the border crossing with Serbia in Roszke How Hungary welcomes its refugees - in pictures Serbia-Hungary border Hungarian armoured personnel carriers are deployed at the border crossing with Serbia in Roszke How Hungary welcomes its refugees - in pictures Serbia-Hungary border Hungarian riot policemen are deployed at the border crossing with Serbia in Roszke How Hungary welcomes its refugees - in pictures Serbia-Hungary border Hungarian police spray water cannon on migrants at the "Horgos 2" border crossing into Hungary, Serbia How Hungary welcomes its refugees - in pictures Serbia-Hungary border A refugee reacts after Hungarian riot police use water cannon to push back refugees at the Hungarian border with Serbia near the town of Horgos How Hungary welcomes its refugees - in pictures Serbia-Hungary border A refugee gestures as Hungarian riot police use water cannon to push back refugees at the Hungarian border with Serbia near the town of Horgos How Hungary welcomes its refugees - in pictures Serbia-Hungary border A refugee throws a stone towards Hungarian riot police after they used water cannon and pepper spray to push back refugees at the Hungarian border with Serbia near the town of Horgos How Hungary welcomes its refugees - in pictures Serbia-Hungary border Refugees protest as Hungarian riot police fires tear gas and water cannon on the Serbian side of the border, near Roszke How Hungary welcomes its refugees - in pictures Serbia-Hungary border Migrants shout slogans as they stand in front of a barrier at the border with Hungary near the village of Horgos, Serbia How Hungary welcomes its refugees - in pictures Serbia-Hungary border Hungarian riot policemen run as they are deployed at the border crossing with Serbia in Roszke Reuters How Hungary welcomes its refugees - in pictures Serbia-Hungary border Hungarian riot policemen are deployed at the border crossing with Serbia in Roszke Reuters How Hungary welcomes its refugees - in pictures Serbia-Hungary border Refugees stand in front of a barrier at the border with Hungary near the village of Horgos, Serbia Reuters How Hungary welcomes its refugees - in pictures Serbia-Hungary border Refugees wait at the Horgos 2 border crossing EPA

"The crisis is growing and being pushed from one country to another," said Adrian Edwards of UNHCR. "You aren't going to solve these problems by closing borders."

In Croatian border towns, like Beli Manastir, refugees are sleeping on the streets and train tracks before scrambling to board local buses with no guarantee that it will get them any nearer to Hungary.

Much of the boundary between Serbia and Croatia is divided by the Danube River, where almost all international bridges have been closed.

The UNHCR says more than 442,440 people have crossed the Mediterranean Sea to Europe so far this year and 2,921 have died attempting the voyage.