BUDAPEST, Hungary -- Hungary stunned migrants and European partners Tuesday by blocking asylum-seekers from its westbound trains, a move that raised new challenges for the EU's passport-free travel zone and could drive many into the reckless hands of cross-border smugglers.

Hungary's right-wing nationalist government defended its U-turn -- just days after it started permitting migrants on the trains without any coherent immigration controls at all -- as necessary to send a get-tough signal. Cabinet ministers told lawmakers that the nation, struggling to cope with more than 150,000 arrivals this year, was determined to seal its borders to unwelcome travellers from the Middle East, Asia and Africa.

Human rights activists criticized the action as futile and reckless, given that eastern European gangs have mobilized fleets of vehicles for illegally transporting migrants to Austria, Germany and elsewhere -- but at steep prices and in often dangerous conditions. They warned that blocking public transportation would increase risks of a repeat of last week's tragedy when the bodies of 71 people, apparently suffocated, were found in the back of an abandoned truck near Vienna, Austria.

"There is no logic behind what Hungary is doing: Yesterday they let migrants use the trains, and today they do not," Gabor Gyulai, refugee program co-ordinator for a Budapest-based rights group called the Hungarian Helsinki Committee, told The Associated Press. "By not allowing them to move onward into Europe in a regular manner by buying a ticket, it's a certainty that this new policy will push them into the hands of smugglers. It is a terrible outcome."

Confusion reigned at Budapest's central Keleti train station as migrants arrived with tickets in hand, often costing 200 euros ($225) each or more, intending to take the morning service to Vienna and the southern German city of Munich. Barring their way were lines of maroon-capped Hungarian police, some of them in body armour.

Police initially suspended all services at Keleti and blocked its grand main entrance. Within hours, non-migrant passengers were allowed through a side entrance after showing passports, visas or other national IDs, while Hungarian speakers were waved through.

Hungarian State Railways announced it would not sell tickets to customers without proper ID and, where required, visas. It said customers could buy tickets only for themselves unless they showed valid IDs and visas for every passenger.

The thwarted migrants faced another night near the station, which has become a concrete campsite as tens of thousands surged north this summer from non-EU member Serbia. Most began their journey weeks ago from Turkish refugee camps bordering the civil war in Syria and hope to reach Germany, which has offered asylum to war refugees and expects to receive a staggering 800,000 migrants this year alone.

Outside the station, more than 300 people stood, many shouting protest slogans or waved tickets, hoping that police might let them through. A few made makeshift signs pleading for help from the EU or United Nations. One man drew on a pizza box a picture of a moving train, a crying child and the plaintive message "Germany!"

Hundreds of smuggler vehicles appeared ready to fill any vacuum created by Hungary's closure of train access.

An AP team at Hungary's border with Serbia near midnight drove past scores of vehicles idling at two small gas stations. Migrants, who were walking into Hungary via a nearby rail line, said smuggler representatives in Serbian camps had told them of a taxi service being run from the gas stations. A ride to Austria started around 1,000 euros ($1,130) each, the migrants said.

In Berlin, German Chancellor Angela Merkel warned that the EU's longstanding commitment to passport-free travel, observed by all members except island nations Britain and Ireland, was under threat by the refusal of many nations in the bloc to share the load from the unprecedented wave of asylum-seekers.

She defended Germany's commitment to shelter war refugees, particularly from Syria, and said other nations needed to do so. The willingness to take more migrants and assess them for refugee status "should be the same in every European country," she said.

But Hungary's leaders vowed, somehow, to stop unwanted migrants from crossing their country. Cabinet ministers said a bill being debated this week in Parliament would authorize the deployment of more than 3,000 troops along the Serbian frontier, the creation of jail-style, fast-track migrant centres able to reject and deport migrants back to Serbia, and other measures intended to end Hungary's previous status as an open back door into the EU.

Janos Lazar, chief of staff to Prime Minister Viktor Orban, blamed Germany and what he called other "left-wing governments" in Europe for encouraging the rush of migrants. "The defence of our borders is important, not opening the borders," he said.

Human rights advocates called Hungary's flip-flopping actions incoherent. They said its open residential centres for asylum-seekers already were overcrowded, meaning migrants must find another way west. They predicted increased business for smugglers, and that Hungary would have to make another U-turn and permit migrants on trains again.

"These refugees always will find their way to the West no matter what barriers are put in their way," said Gyulai of the Helsinki rights committee. "This just makes them wait and suffer and spend their last pennies on train tickets they cannot use. This is simply done to give a fake impression to the EU that Hungary is 'taking action,' no matter what the human and legal consequences are."

Police searches for suspected smuggler vehicles produced traffic jams for Austria-bound traffic near the Hungarian border village of Hegyeshalom.

Early Tuesday, police stopped a van crammed with 24 Afghans on the outskirts of Vienna, said police spokesman Thomas Keiblinger. The van's door was welded shut and locked from the outside, he said, leaving the passengers with no access to fresh air.

All were in good health because they had not been in the van long, although they were in "acute danger of death," he said, and the driver, a Romanian, was arrested.

Orban faces tough questions Thursday in Brussels by EU leaders at a summit on the crisis. Many other nations, including entry points Greece and Italy, also face pressure to do more to improve migrants' support and safety.

European Council President Donald Tusk warned Hungary and others they must treat migrants with respect as fellow humans in need. He warned of the dangers of policy decisions that benefit smugglers.

"Europe's priority remains preventing immigrants from losing their lives when trying to reach Europe. Whatever challenges migration might bring, there is never justification for hostile races or xenophobic reactions to migrants," Tusk said in Croatia.

Mohammed, a 24-year-old Syrian economist, said he had bought a ticket to Munich for 200 euros ($225) after Hungarian police told him Monday night he would be allowed to leave by this route. Thousands of other asylum-seekers had taken the westbound trains Monday.

But police blocked him from the platform Tuesday. They told him he needed a German visa in addition to his Syrian passport, he said, refusing to give his last name because he feared for his family's safety in Aleppo.

"This is crazy," said Baba Mujhse, a Egyptian-Hungarian volunteer in the station. He carried a boy who got separated from his family in the uproar. He said the decision to block migrants from the trains was "not a solution to anything."

As night fell, about 150 migrants staged a sit-down protest outside the station, where about 20 police stood guard. Most migrants erected tents at a nearby plaza, where aid workers say already more than 2,500 are camped.

Many Hungarians appeared to give the station a wide berth at the evening rush hour. The night train to Vienna appeared less than a quarter full.

Hungary's decision may have been influenced by pressure from Austria, which has struggled to cope with masses of migrants on Hungarian trains. Vienna police said 3,650 migrants arrived Monday from Hungary, with most heading to Germany.

Austrian authorities renewed border controls at main crossings from Hungary for the first time since December 2007, when Hungary joined the EU's passport-free travel zone.

Also Tuesday, Greece's coast guard said it rescued nearly 1,200 migrants, significantly more than usual, off its eastern Aegean islands in the past 24 hours. More than 2,000 migrants have drowned this year, including 200 last week, chiefly when trying to reach Italy's southernmost islands from Libya.