Migrants threw themselves onto railway lines and scuffled with helmeted riot police trying to take them to a reception center in Hungary on Thursday, forced from a train in desperate scenes symbolic of a European asylum system brought to breaking point.
In Budapest, lawmakers debated changes to entry laws that the right-wing government said would close the country to migrants as of Sept. 15, after nine months in which some 140,000 have been caught crossing from neighboring Serbia en route to western Europe.
Seeking to end a two-day standoff at the capital's main railway station, police who had barred entry to some 2,000 migrants for the past two days suddenly stepped aside.
Crowds surged past, cramming onto trains many believed would take them to Austria, Germany and the end of a sometimes perilous journey from the Middle East, Africa and Asia.
Exhausted and confused, they clung to doors and squeezed their children through open carriage windows.
But some 35 kilometers (22 miles) west of Budapest, the train bound for the border town of Sopron stopped in Bicske, where Hungary has a migrant reception center.
Riot police ordered them off, but many migrants resisted, laying on the railway line or fleeing. Some wrestled with police, trying to get back on board. One man threw himself on the tracks with his wife clutching their small child.
Those who refused to disembark banged on the windows of the train and shouted "No camp, no camp!" Police cleared one carriage, while five more stood in the station in the heat. They later declared the railway station an "operation zone" and ordered journalists to leave.
"We need water," said a Syrian man who was still on the train and gave his name as Midu.
"Respect the humans in here; no respect for the humans. We want to go to Germany, not here," he said in English.
"A German problem"
The primary entry point for migrants - many of them Syrian refugees - traveling overland across the Balkans, Hungary is building a 3.5 meter-high fence along its 175 km frontier with Serbia.
Lawmakers were debating a raft of amendments to Hungary's migration laws that the ruling party said would cut illegal border crossings to "zero".
They provide for the creation of holding zones on the country's southern border with Serbia, where asylum requests would be processed and those rejected potentially expelled.
The amendments also introduce tougher punishment for those who cross illegally or damage the new fence, which has emerged as a potent symbol of the migrant crisis with its Cold War echoes in ex-Communist eastern Europe.
"We create just now in the Hungarian parliament a new package of regulations, we set up a physical barrier and all these together can provide a new situation in Hungary and in Europe from 15 September," Prime Minister Viktor Orban told reporters in Brussels after talks with European Parliament President Martin Schultz.
"Now we have one week of preparation time."
Hungary on Monday had allowed migrants to board trains to western Europe, despite EU rules which bar travel by those without valid documents, but then called a halt on Tuesday.
Explaining Monday's decision, the Hungarian government on Thursday cited Germany's decision to relax rules for Syrian refugees, accepting their asylum claims regardless of where they entered the bloc. EU rules normally require them to register and remain in the first EU country they reach. Germany says it expects to receive 800,000 asylum seekers this year.
Citing the chaos at Budapest's main railway station, Orban's chief of staff, Janos Lazar, told a news conference: "This is because Germany ... more than a week ago told Syrians that Germany awaited them, inviting them to the laid table."
As more desperate scenes unfolded on Thursday, Orban said Hungary was simply following the rules.
"The problem is not a European problem. The problem is a German problem," he said "Nobody would like to stay in Hungary, neither in Slovakia, nor Poland, nor Estonia. All of them would like to go to Germany. Our job is only to register them. So if the German chancellor insists that nobody can leave Hungary without registration towards Germany, we will register them. It's a must."
In an opinion piece for Germany's Frankfurt Allgemeine Zeitung, Orban said "Europe's own Christian values" were at stake from the influx of mainly Muslim migrants.
At the Budapest train station, 17-year-old Ysra Mardini from the Syrian capital Damascus, said she feared being taken to a detention camp.
"We want to go to Germany but that train in the station, maybe it goes nowhere. We heard it may go to a camp. So we will stay out here and wait."