Migrants threw themselves onto train tracks and fled from police trying to take them to a reception centre in Hungary on Thursday as authorities sought to end a standoff that has become symbolic of a European asylum system brought to breaking point.
With the government promising to close the country off to migrants by Sept. 15, chaos broke out after a train bound for Hungary's border with Austria was stopped some 35 kilometres (22 miles) outside of Budapest in the town of Bicske, where Hungary has a migrant reception centre.
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.
Those who refused to disembark banged on the windows of the train and shouted "No camp, no camp!"
A family - a man, his wife and their toddler - made their way on the track next to the train and lay down in protest. It took a dozen riot police wrestling with the man to get them up again.
The train left from Budapest's main railway station on Thursday morning after police, who for two days had barred entry to more than 2,000 migrants, stepped aside and a crowd surged past.
Many of the migrants believed they were heading for Austria, Germany and beyond, nearing the end of a sometimes perilous journey from the Middle East, Africa and Asia.
Exhausted and confused, they crammed into a waiting train, clinging to doors and squeezing their children through open carriage windows.
Trains to Vienna and Germany were cancelled, but domestic trains, many of them heading for border towns in western Hungary, were leaving.
"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," said Ysra Mardini, a 17-year-old from the Syrian capital Damascus, dressed in jeans and a T-shirt.
As the train departed, 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 construction crews are completing a 3.5-metre-high fence.
Hungary has emerged as a flashpoint, as the primary entry point for those travelling overland across the Balkans. Its right-wing government is among the continent's most outspoken voices against allowing mass immigration.
Prime Minister Viktor Orban, in Brussels for talks with European leaders, said Hungarians and Europeans were "full of fear because they see that the European leaders ... are not able to control the situation."
In an opinion piece for Germany's Frankfurt Allgemeine Zeitung, he wrote that his country was being "overrun" with refugees, most of which, he noted, were Muslims, not Christians.
"That is an important question, because Europe and European culture have Christian roots. Or is it not already and in itself alarming that Europe's Christian culture is barely in a position to uphold Europe's own Christian values?" he asked.
Read more here:
His name was Aylan, the little Syrian boy who, lifeless, lay on a Turkish shore. Tiny and helpless in his new state of eternal stillness. And yet he speaks to the whole world. He speaks of failure and abandonment, of a willingness to pay lip service to compassion but of a reluctance to show it. About two thousand others have perished as the sparkling Mediterranean becomes a graveyard.