The arrival of hundreds of thousands of refugees and economic migrants has confounded the EU, which has no border controls for travel between 26 countries of its Schengen area but requires those seeking asylum to remain in the country where they first arrive until their applications are processed.
The vast majority of those arriving first reach the continent's southern and eastern edges, and are determined to travel across Europe and seek asylum in what are seen as more generous countries farther north and west.
Hungary is on a major overland transit route from the Middle East and Africa for refugees who flee violence and for economic migrants escaping poverty, with more than 140,000 people crossing its southern border with Serbia this year alone.
Hungarian and Austrian authorities allowed trainloads of undocumented refugees to reach Germany on Monday. Czech police said they had detained 214 mostly Syrian refugees headed for Germany on overnight trains from Vienna and Budapest.
The crisis has prompted the government in Budapest to reinforce its border with a razor wire fence and deploy thousands of extra police to try to funnel the arrivals to legal channels, rather than allowing them through unchecked.
Faced with the enormous pressure of thousands upon thousands of people arriving in Budapest, Hungary let them board westbound trains on Monday before unexpectedly shuttering the train station again on Tuesday morning.
Government spokesman Zoltan Kovacs, when asked why the railway terminus was closed, said Hungary was trying to enforce EU law, which requires anyone who wishes to travel within Europe to hold a valid passport and a Schengen visa.
Marah, a 20 year-old woman from Aleppo, Syria, who traveled with her family, said they had bought six tickets for a RailJet train that was scheduled to leave for Vienna at 9 a.m. on Tuesday.
“They should find a solution,” she said. “We are thousands here, where should we go?”
Hungary's ruling center-right Fidesz party, led by Prime Minister Viktor Orban, has struck a combative tone in the migrant crisis. Antal Rogan, the Fidesz party's parliament caucus leader, said on Tuesday that “the very existence of Christian Europe” was under threat.
“Would we like our grandchildren to grow up in a United European Caliphate? My answer to that is no,” Rogan told the pro-government daily Magyar Idok.