Doctor Ali has spent the last four years trying to save the lives of his fellow residents in the town of Saraqeb, in the Idlib region of Syria. “Every day, we treated the wounded from the bombardment and dug out the dead,” he told me.

Doctor Ali, 25, spent four years working in the hospital in Saraqib, Syria. He fled after he witnessed a close friend killed in a barrel bomb explosion dropped by a Syrian army helicopter. He wants to go to Germany and continue with his medical studies.

Two weeks ago, he was at his best friend’s shop when a Syrian government helicopter suddenly appeared overhead and dropped a barrel bomb that exploded close by. He escaped injury, but his friend was hit by shrapnel and died on the spot. It was at that moment, Ali said, after living through four years of horror in Syria that he decided to risk his life and make the long and hazardous journey to seek refuge in Germany.

When we first met last Monday at Budapest’s Keleti train station, he was among thousands of mostly Syrian asylum seekers patiently waiting in line to buy a train ticket to Munich, Germany. Ali was elated: after crossing the sea from Turkey to Greece, then walking across Greece, Macedonia, and Serbia, and spending days in a filthy Hungarian detention center, his goal finally seemed in sight. He said he was looking forward to sleeping in a real bed after two weeks of roughing it in the open air, with no access to a shower. That day, at least four trains packed with mostly Syrian asylum seekers made the journey to Munich, raising the hopes of the many thousands of Syrians and other asylum seekers currently stranded there.

Hungary has become the latest country to try to stem the tide of asylum seekers, building fences on its borders, sending people to detention camps in horrible conditions, and trying to prevent them from going to Western Europe. It argues that it is obliged to do so under the European Union’s problematic Dublin regulation, which requires most asylum seekers to seek protection in the first EU country they reach.

But after four years of brutal war in Syria – headed by international inaction to stop the slaughter – the more fortunate of Syria’s beleaguered citizens are using their last savings to make a determined effort to seek refuge in Europe and a life for their children. Thousands have made it to Hungary.

The personal stories of those I have spoken to are of asylum seekers fleeing persecution and war, not the “economic migrants” European policy makers keep mentioning to justify their attempts to stop the flow with fences. They are fleeing the beheadings and executions of the extremist group Islamic State (also known as ISIS), the barrel bombs of the Syrian army, possible arrest by the security agencies, and attempts to forcibly recruit them into the Syrian government’s army, which is responsible for the slaughter of tens of thousands of their fellow citizens.

This past week, my colleague and I watched the Serbian-Hungarian border as hundreds more walked into Hungary, avoiding the razor-wire fence the Hungarian government has erected to stop them. Almost all of the families crossing had young children with them, toddlers and even babies, exhausted from the heat and the difficult journey. They told us that in Hungary they had faced the most difficult leg of their arduous journey.

If Hungary was serious about respecting EU law, it would provide proper reception conditions and access to asylum for these people. For the moment, it does little more than make the lives of the asylum seekers miserable. Virtually no humanitarian assistance is provided by the government for the thousands camped around the train station, who rely on a single water source and the kindness of strangers to survive, sleeping everywhere in the open.

By Tuesday, Doctor Ali had lost all hope. The train ticket to Munich he had spent hours in line for was now worthless, as the police prevented Syrians from boarding the trains. He reached out to smugglers, the kind of criminal networks responsible for the suffocation of 71 Syrians just a few days ago in a closed truck heading to Austria.

The smugglers demanded €550 for the short trip to Austria, promising a safe taxi, but then took him to the same kind of closed truck in which his fellow citizens had suffocated. He refused to get on board, and watched as children cried in terror when the doors were locked and closed. “It is just criminal,” he told us later, “Everyone was forced inside and the children were crying in fear.”

It is time for EU countries collectively to acknowledge the reality that its asylum policies are failing, and to accept responsibility to offer safe haven to refugees and others fleeing horrific abuse. Syrians and other asylum seekers should not have to risk dying at sea and on the roads.

To improve the situation, EU governments should take the following steps: First, implement common EU standards on access to asylum and reception conditions. It should also share responsibility for the asylum seekers equitably among its 28 member states and revise the Dublin regulation. The EU should also maintain search and rescue operations in the Mediterranean. Additionally, it should create a list of “unsafe” countries and offer automatic protection to asylum seekers from those countries, and create safe and legal routes to enter Europe so people are not forced to turn to smugglers.

On Friday, thousands of asylum seekers stranded in Hungary challenged the government, which has worked to keep them in the train station or its reception center. They began walking en mass toward Austria. Initially stunned by the asylum seekers’ bold move, the Hungarian authorities ultimately relented, and bused the marchers to the Austrian border. The extraordinary welcome offered by ordinary Austrians and Germans to those arriving from Hungary is heartwarming. Doctor Ali is among those who have now made it safely to Germany, where he hopes to built a new life and still save others by working in medicine.