Hungary's right-wing government has shut the main land route for migrants into the EU, taking matters into its own hands to halt Europe's influx of refugees.

The action was taken as an emergency effort led by Germany to force European Union member states to accept mandatory quotas of refugees collapsed in discord.

Berlin called for EU financial penalties against countries that refused to accommodate their share of migrants. A Czech official said such threats were empty but nonetheless "damaging". Slovakia said they would bring the "end of the EU".

Under new rules that took effect from midnight, Hungary said anyone seeking asylum at its border with Serbia, the EU's external frontier, would automatically be turned back, and anyone trying to sneak through would face jail.

In scenes with echoes of the Cold War, families with small children sat in fields beneath the former communist country's new 3.5-metre (10 foot) high fence, which runs almost the length of the border, topped with razor wire.

"Strike. No food. No water. Open this border," a woman had written on a child's dress that she held above her head.

Migrants that did try to apply for asylum in a transit zone of metal containers in no-man's land were swiftly denied. Macruf Suhufi Abdi Omar, a Somali man, told Reuters that he had been refused asylum barely an hour after he gave his fingerprints.

Hungarian officials said they had denied 16 asylum claims at the frontier within hours and were processing 32 more. Police had arrested 174 people for trying to sneak across the border.

Prime Minister Viktor Orban, one of the continent's loudest opponents of mass immigration, says he is acting to save Europe's "Christian values" by blocking the main overland route used by mainly Muslim refugees, who travel through the Balkans and cross his country mainly to reach Germany or Sweden.

Amnesty International said Hungary was "showing the ugly face of Europe's shambolic response" to a crisis that has seen hundreds of thousands of people arriving at the EU's southern and eastern edges and making their way to the richer countries further north and west.

The greatest migration to Western Europe since World War Two has also created an institutional crisis for the 28-member EU, with one of the bloc's signature achievements, its Schengen system of border-free travel across much of the continent, unravelling this week under the strain.

Record arrivals forced Germany to reimpose emergency frontier controls this week, with several neighbours swiftly following. Austria, next on the road from Hungary to Germany, said tougher border measures would take effect at midnight.

Germany and other relatively open countries say Europe has a moral obligation to accept refugees, and other EU states must be required to do their part.

Eastern European countries argue that a welcoming stance encourages more people to make dangerous voyages, and risks attracting an uncontrolled influx that would overwhelm social welfare systems and dilute national cultures.

Under its new rules, Hungary said it had determined Serbia was "safe", and therefore it could automatically deny asylum claims at the border.

"If someone is a refugee, we will ask them whether they have submitted an asylum request in Serbia. If they had not done so, given that Serbia is a safe country, they will be rejected," Orban was quoted as telling private broadcaster TV2 on Monday.

"We will start a new era," government spokesman Zoltan Kovacs said shortly after midnight on the border. "We will stop the inflow of illegal migrants over our green borders."

Serbia called the new Hungarian rules "unacceptable". The United Nations disputed the definition of Serbia as safe, saying the poor ex-Yugoslav state lacked capacity to house thousands of refugees turned back at Europe's gates.

Orban says that by reinforcing the EU's external border his government is merely enforcing EU rules, and that no countries are duty-bound to take in refugees that pass through safe states. Critics at home and in European neighbours say some of his rhetoric has crossed a line into alarmism and xenophobia.

Long queues formed in no-man's land at metal containers built into the fence, where migrants were expected to register, though only a handful were seen entering. They had spent the night in the open, given tents, food and water by aid workers.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.