Hundreds of desperate migrants streamed into the main train station in Hungary's capital on Thursday when police stopped blocking the entrance after a fraught two-day standoff.
But announcements over the loudspeakers and on the departures board informed the crowd that services to Austria and Germany, where many hoped to travel, had been suspended for safety reasons.
Amid the confusion, some migrants boarded trains and refused to get off, news reports said.
Hungarian police cleared hundreds of people from one train. Another pulled out of Keleti station with migrants aboard, but stopped in Bicske, a town about 20 miles west of Budapest where a major camp for asylum seekers is located.
Scuffles reportedly broke out with police as migrants refused to leave the train. "No camp!" some of them shouted in Arabic, according to reports from the scene.
One distressed father threw himself, his wife and his child on the tracks and shouted: "We won't move from here!"
Others tried to escape down the tracks on foot. There was widespread chaos, fatigue and distrust.
When police tried to give the migrants bottles of water, some threw them back, fearing they had been drugged in an effort to sedate them, the Associated Press reported.
The closure of Keleti station on Tuesday marked a sudden change in tactic from the previous day, when more than 1,000 migrants were allowed to board westbound trains. It caused a surge of people to head to the station, where a makeshift, squalid camp quickly emerged.
Frustrated migrants chanted "Germany! Germany!" and held up signs pleading: "Please open the station."
Many of the people fleeing to Europe from their war-torn homelands in the Middle East, Africa and Asia hope to reach Germany and other wealthier nations, where they see a future for themselves and their families.
In a departure from normal European Union procedure, Berlin has said that it will allow Syrians to apply for asylum in Germany rather than send them back to the country where they first entered Europe. It expects to take in a staggering 800,000 refugees this year.
In contrast, Hungary has been erecting a razor-wire barrier to deter the thousands of migrants attempting to cross into the country from Serbia and has sent 3,500 troops to defend it.
Hungarian Prime Minister Viktor Orban, who was in Brussels on Thursday for emergency meetings with European officials, blamed Germany for the influx of people streaming through his country.
For the Record
Sept. 3, 2:20 p.m.: An earlier version of this article incorrectly identified Viktor Orban as Hungary's president. He is the prime minister.
"The problem is not a European problem. The problem is a German problem," he said at a news conference with European Parliament President Martin Schulz. "Nobody would like to stay in Hungary."
The Hungarian parliament is expected to approve measures Friday to tighten security at the country's borders, including fingerprinting and screening all migrants, Orban said.
"We Hungarians are full of fear," he said. "People in Europe are full of fear because we see that European leaders, among then the prime ministers, are not capable of controlling the situation."
German Chancellor Angela Merkel said that the burden of taking in hundreds of thousands of migrants shouldn't fall on a few EU states and called on all 28 members to accept a fair quota.
"Germany is doing what is morally and legally required of it. No more, no less," she was quoted as saying by Germany's DPA news agency during a visit to the Swiss capital, Bern. "This is a problem that concerns us all."
Heartbreaking photographs of a drowned Syrian toddler, whose body washed up Wednesday on a beach in Turkey, have added to the sense of urgency to find a solution to Europe's largest refugee crisis since World War II.
French Prime Minister Manuel Valls tweeted one of the photographs with the message: "He had a name: Aylan Kurdi. Urgent to act. Urgent to have a European mobilization."
British Prime Minister David Cameron said he felt "deeply moved" by the image and vowed that Britain would fulfill its "moral responsibilities."
But the issue remains politically divisive in a number of countries.
Boyle is a special correspondent. Times staff Writer Alexandra Zavis in Los Angeles contributed to this report.