Scuffles have broken out west of the Hungarian capital, Budapest, after police tried to force migrants off a train at a refugee camp.
Amid chaotic scenes, police ordered journalists from the scene at Bicske, declaring it an "operation zone".
The train had left Budapest hours after police let migrants into the railway station following a two-day stand-off.
Meanwhile, there have been sharp disagreements among European leaders over how to deal with the crisis.
In Brussels, Hungary's Prime Minister Viktor Orban described the situation as a "German problem" as Germany was where those arriving in the EU "would like to go".
But European Council President Donald Tusk said that at least 100,000 refugees should be distributed across EU states.
In other developments on Thursday:
- German Chancellor Angela Merkel and French President Francois Hollande said they would present joint proposals for the redistribution of refugees within the EU
- Czech police are to stop writing numbers on migrants' hands after criticism from human rights groups
- Turkish President Recep Tayyip Erdogan accused European nations of turning the Mediterranean into a "cemetery for refugees"
- Bayern Munich football club said it would set up a training camp for refugees coming into Germany
The human cost of the crisis was put into sharp focus on Wednesday when five children were among 12 migrants who drowned in Turkish waters while trying to reach Greece.
Images of the washed-up body of three-year-old Alan Kurdi, who died alongside his mother and five-year-old brother, circulated widely on social media.
Earlier on Thursday, migrants who had been camped outside Budapest's Keleti railway station surged on to the platforms as soon as police withdrew.
The BBC's Gavin Hewitt on board the train at Bicske
Nothing illustrates how difficult this crisis is to resolve than what has happened to these several hundred refugees who are currently on this train at Bicske.
There were some police on board. We got as far as Bicske and when the train pulled in, there were loads of police waiting for them on the platform. The plan seemed to be to take them to a centre where they would be properly identified. Some people left the first carriage, but almost immediately there was resistance. A lot of people were banging on the windows - some were shouting "Germany! Germany!" The police put on riot gear.
Some refugees who had been taken off the train began pushing and jostling and there was a little bit of fighting with riot police. And then they forced their way back on the train, which is where we are at the moment with police on the platform and several hundred refugees on the train.
International services were suspended at Budapest's station but hundreds crammed on to the first train hoping it would take them to the Austrian border.
Instead, the train stopped at the Hungarian town of Bicske about 40km (25 miles) west of Budapest which hosts a major refugee camp, and police lined the platforms.
Some migrants at first left the train but then forced their way back on when they realised where the authorities wanted them to go.
They fear that registering at the camp will make it harder for them to seek asylum in Germany and other countries.
By Nick Thorpe, BBC Budapest correspondent
Hungarian Prime Minister Viktor Orban is a political leader who thrives on conflict.
While he tolerates no dissent within his Fidesz party, he enjoys taking on his opponents. But in the refugee crisis now overwhelming Hungary, he is attacking not only the migrants themselves, but, increasingly, Germany.
Mr Orban himself has described proposals for binding quotas of refugees to be accepted by all EU countries as "idiotic" - a personal insult to Chancellor Angela Merkel.
His aim now seems to be two-fold: to stir up xenophobia at home by appearing both patriotic and powerful and to reach out to anti-migrant opinion across Europe.
Back in Budapest, about 2,000 migrants are still camped outside the Keleti station with more in nearby John Paul II square and at Nyugati railway station across the city.
"I think (the train) was a trick by the government, the police and the train company, " said Marton Bisztrai, a volunteer at Keleti.
"The train looked like it was going to Germany."
The number of migrants entering Europe has reached record levels this year. Germany expects to take in 800,000 asylum seekers this year - four times last year's total.
The surge in numbers has created tension and disagreement over EU migration policy. Germany has been prepared to accept large numbers of asylum seekers, but other countries have not.
During a tense press conference in Brussels with European Parliament President Martin Schulz, Mr Orban, who heads the anti-immigration Fidesz party, said Hungarians "were full of fear because they see that the European leaders... are not able to control the situation".
"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," he said.
Mr Tusk took Mr Orban to task for saying in a newspaper interview that Hungary was being "overrun" with refugees who threatened to undermine Europe's Christian roots.
"Referring to Christianity in a public debate on migration must mean in the first place the readiness to show solidarity and sacrifice," he said.
Mr Tusk's call for at least 100,000 asylum seekers to be redistributed across EU states is a sharp increase on a previous European Commission target of 40,000.
Migrants or refugees?
The word migrant is defined in the Oxford English Dictionary as "one who moves, either temporarily or permanently, from one place, area, or country of residence to another".
A refugee is, according to the 1951 Refugee Convention, any person who "owing to a well-founded fear" of persecution is outside their country of nationality and "unable" or "unwilling" to seek the protection of that country. To gain the status, one has to go through the legal process of claiming asylum.
The word migrant has traditionally been considered a neutral term, but some criticise the BBC and other media for using a word they say implies something voluntary, and should not be applied to people fleeing danger.