Local cyclists on Sunday move past a group of Afghan men sleeping in Morahalom, Hungary after crossing from nearby Serbia. (Darko Bandic/AP)

The 71 people whose bodies were found in an abandoned truck on the main highway between Budapest and Vienna last week may have died at the hands of smugglers. But critics are also blaming a broken European refugee system that is increasingly forcing desperate asylum-seekers into the arms of human traffickers.

Perhaps nowhere is that more true than in Hungary, the nation the perished migrants were smuggled through. This country, now led by right-wing nationalists, is fast emerging as the toughest obstacle for a record number of refugees trying to reach Europe from war-torn Syria, Iraq and other nations.

Hungary is building a 109-mile-long razor-wire fence on its southern border meant to keep out migrants. But as they come ashore in Greece, then try to reach the wealthy core of Europe — nations such as Germany, Sweden and Austria — the asylum-seekers’ path to sanctuary runs straight through Hungary.

The government of Prime Minister Viktor Orban has taken a decidedly anti-migrant stance, with new rules making it harder to win asylum. The partially built Hungarian fence, critics say, has pushed more migrants to hire traffickers to get through.

Yet migrants are also hiring smugglers because they are terrified of getting caught and processed here. A quirk of European law allows the wealthier nations farther west to deport migrants back to Hungary, leaving them at the mercy of a government that has granted legal asylum to only 278 of the 148,000 people who have applied this year, according to the U.N. High Commissioner for Refugees (UNHCR).

The Hungarian government counters that many of those arriving are economic migrants, not true asylum-seekers fleeing war zones. “This continent won’t be your home. This is our home,” Orban said in a radio address.

And yet paradoxically, as tough as it is to get into Hungary, migrants stranded here say it is just as hard to get out. That’s because Hungary is also barring refugees from leaving, citing E.U. laws that restrict the movement of migrants after they are formally processed. The government says it is also responding to requests from nations such as Germany and Austria that are seeking to limit the flow of migrants west.

That is leaving thousands trapped. On Sunday, Hungarian police, using blatant racial profiling, stood in front of Budapest’s main train station, allowing white and lighter-skinned people to pass through but stopping and demanding papers from virtually all darker-skinned people. The policy has led to an expanding tent city, where hundreds of exhausted migrants, mostly from Syria and Iraq, sat on the sidewalk. Children played with found or donated toys. Families were closely rationing food and water.

Now so close to their targets, many were weighing whether to make a break out of Hungary with hired smugglers.

Fatima, a 24-year-old Iraqi mother cradling her 4-year-old boy outside the station, said she and her husband have been trying for the past four days to board a train to seek asylum in Belgium. She said she can easily understand what possessed the 71 migrants believed to have suffocated to death last week to step into the darkened cargo area of a smuggler’s truck.

“Those people in that truck put their faith in God and got inside because they, like us, had no other choice,” said Fatima, who declined to give her last name for fear of Hungarian authorities. She pointed to the hundreds of other migrants camping out, saying: “We’re all just like them. We all just want to get out of Hungary and move on. But they will not let us go, so maybe we will have to take the same risk those people did.”

A record number of migrants and refugees are attempting perilous journeys to find a safer, better life in Europe. Here's why they're leaving and how they're being received. (Jason Aldag and Gillian Brockell/The Washington Post)

Critics say asylum-seekers are taking greater risks in Hungary and elsewhere in the European Union because of a patchwork of convoluted regulations. Said Karl Kopp, spokesman for the refugee rights group Pro Asyl, “Nobody would get on a cooling truck from Hungary to Austria or Germany if he was able to take a train.”

Under the rules that govern how Europe handles new arrivals, known as the Dublin Regulation, migrants can be sent back to the first E.U. nation they entered. Because its reception facilities are so bad, the rule does not apply to Greece. And some nations, including Sweden and Germany, have said they will waive the rules for Syrians.

There isn’t a uniform benefits system, either, with nations such as Hungary offering little compared with Germany and Sweden. Acceptance rates also vary dramatically. Hungary, for instance, is granting asylum to only a fraction of 1 percent of applicants, according to UNHCR. Germany, meanwhile, has a nearly 40 percent acceptance rate — and almost 90 percent for Syrians.

European nations have failed to agree on policies — such as a refugee quota for each E.U. country — that might make it easier to grant safe passage and resettlement rights to legitimate asylum-seekers while weeding out economic migrants.

“The problem is that the European system is dysfunctional, and when a system is dysfunctional, refugees are going to put themselves in danger,” said Babar Baloch, spokesman for UNHCR in Budapest. “Especially in Hungary, they are being pushed to take risks because they have no other legal way.”

Hungary, however, is indeed being inundated with migrants, now reaching a record 3,000 a day, compared with 6,903 during all of 2011. The nation is offering shelter to refugees at several camps. At sites like the Budapest train station, “transit centers” have been built with showers, toilets and drinking water.

Hungarian officials say they are simply protecting Europe’s borders. “Think with the brains of an American,” said Zoltan Kovacs, a government spokesman. “Would it be acceptable, even if you are a refugee coming from war, to enter the U.S. illegally and without papers? No.”

But Fortress Hungary, as the country’s migrant policies have become known, is taking a toll. Outside the train station, Fatima, the Iraqi woman, who said she was fleeing Islamic State incursions near her home south of Baghdad, said she, her husband and son paid smugglers 2,600 euros ($2,912) last week to get them through an opening in Hungary’s fence. Once they got over and most of the other migrants dispersed, she said, the smugglers held her and her son at knifepoint and demanded that her husband pay an extra $1,000.

“We paid,” she said.

Fatima and other migrants say smugglers are charging about 550 euros ($616) to get from Budapest to Vienna. But they have heard stories that the private cars offered turn out to be trucks or other crowded vehicles.

Many of those camped outside the station were Syrians. “We want to go to Germany,” pleaded Mohamed al-Omar, an electrical engineer from Homs who was trying to talk his way past the guards. He was traveling with his wife and their 1-month-old son.

“Why won’t they just let us go?” he said afterward. “Okay, then we all have to take smugglers? Is that the only answer? Then some of us will die, some of us will live, but we are not going to stay here.”

Birnbaum reported from Brussels. Gergo Saling in Budapest and Stephanie Kirchner in Berlin contributed to this report.

Read more:

Discovery of more than 70 bodies in truck highlights European migrant crisis

Black route: One family’s journey from Aleppo to Austria

A global surge in refugees leaves Europe struggling to cope

Today’s coverage from Post correspondents around the world