Hungary made plans on Wednesday to reinforce its southern border with helicopters, mounted police and dogs, and was also considering using the army as record numbers of migrants, many of them Syrian refugees, passed through coils of razor-wire into Europe.
In Germany, which expects to receive 800,000 of them this year, Chancellor Angela Merkel was heckled by dozens of protesters as she visited an eastern town where violent anti-refugee protests erupted at the weekend.
The surge in migrants seeking refuge from conflict or poverty in the Middle East, Africa and Asia has confronted Europe with its worst refugee crisis since World War Two, stirring social tensions and testing the resources and solidarity of the 28-nation European Union.
A record 2,533 mainly Syrians, Afghans and Pakistanis crossed from Serbia into EU member Hungary on Tuesday, climbing over or squirreling under a razor-wire barrier into the hands of an over-stretched police force that struggled to fingerprint and process them. Authorities said over 140,000 had been caught entering so far this year.
Unrest flared briefly at a crowded reception centre in the border region of Roszke, with tear gas fired by police.
Another 1,300 were detained on Wednesday morning. More will have passed unnoticed, walking through gaps in a border fence being built by Hungary in what critics say is a futile attempt to keep them out. They packed a train station in the capital, Budapest, hundreds of men, women and children sleeping or sitting on the floor in a designated "transit zone" for migrants.
Almost all hope to reach the more affluent countries of northern and western Europe such as Germany and Sweden.
Visiting the eastern German town of Heidenau, where violence broke out during weekend protests by far-right militants against the arrival of around 250 refugees, Merkel said xenophobia would not be tolerated. About 50 protesters booed, whistled and waved signs that read "Volksverraeter" (traitor), a slogan adopted by the anti-Islam PEGIDA movement earlier this year.
"There is no tolerance for those people who question the dignity of others, no tolerance for those who are not willing to help where legal and human help is required," Merkel told reporters and local people. "The more people who make that clear ... the stronger we will be."
With frequent attacks on refugee shelters and warnings of rising intolerance of foreigners, Merkel's cabinet agreed to double the funding this year to help towns cope with the record number of arrivals.
Hungary, which is part of Europe's Schengen passport-free travel zone, is building a 3.5-metre high fence along its 175-km (110-mile) border with Serbia, taking a hard line on what right-wing Prime Minister Viktor Orban says is a threat to European security, prosperity and identity.
Government spokesman Zoltan Kovacs said parliament would debate next week whether to employ the army in the border effort.
The numbers travelling through the cash-strapped Balkans have soared in recent weeks, with 3,000 crossing into Macedonia daily from Greece.
The chief commissioner of Hungarian police, Karoly Papp, said police were readying six special border patrol units of an initial 2,106 officers, equipped with helicopters, horses and dogs, to be sent in depending on the situation on the Serbian border.
"They don't have and will not get an order to shoot," Papp told a news conference.
In Roszke, the police spokesman said some 200 migrants at the reception centre where unrest flared had refused to be fingerprinted, fearing that, as per EU rules, if they are stopped later elsewhere in the EU they will be returned to Hungary as their official point of entry.
"My brother is in Sweden," said one migrant, who declined to be named. "He told me to chop my hands off rather than give my fingerprints to the Hungarians. So we're trying to find a way to Austria without meeting the Hungarian police."
Some spent the night in the open on the border, warming themselves around open fires and roasting corn plucked from the fields. As day broke, parents tried to rouse exhausted children.
Rabie Hajouk, a 29-year-old IT engineer who said he was from the devastated Syrian city of Homs, told Reuters: "It's not for money or for food, it's for freedom, freedom of mind, for education."
Embroiled in a debilitating economic crisis, Greece has taken to ferrying mainly Syrian migrants from its overwhelmed islands to Athens. Some 50,000 hit Greek shores by boat from Turkey in July alone.
Some European leaders have complained that Greece fails to register its arrivals, meaning their first recognised point of entry is often elsewhere and Athens does not risk them being sent back.
The issue will be on the agenda of a conference in Vienna on Thursday of Balkan leaders, joined by Merkel and EU foreign policy chief Federica Mogherini.
Serbia said around 10,000 migrants were passing through the country at any time, their stay lengthening as Hungary nears completion of its border fence.
Prime Minister Alexander Vucic told Reuters Serbia would never close its borders but was looking for answers.
"What we want to hear tomorrow from Chancellor Merkel...from Federica Mogherini...is, what is the plan?" he said.