Hungary's right-wing government shut the main land route for migrants into the EU on Tuesday, taking matters into its own hands to halt Europe's unprecedented influx of refugees while the bloc failed to agree a plan to distribute them.

Crowds of migrants built up at Serbia's northern border with Hungary, their passage blocked by a razor wire fence.

Under new rules that took effect from midnight, Hungary says anyone seeking asylum at the Serbian border will automatically be turned back. Anyone trying to sneak through will face jail.