In the end, a river ran through it. A river of at once joyous and troubled humanity.
For days, Hungarian authorities had tried to stanch the flow of migrants and refugees through their territory on the way to wealthier havens in northern Europe, ensnaring thousands even while the government made clear it had no wish for them to stay.
Hungarians rushed to finish building a fence along their southern border with Serbia. Trains that would have carried refugees on to the frontier with Austria were halted. Hundreds seeking to travel onward were detained, while thousands took shelter in a squalid encampment near a train station in Budapest, the Hungarian capital.
On Saturday, after protracted negotiations with Germany and Austria, the Hungarians finally threw up their hands — and the effect was akin to that of a cork popping, or a dam breaking. About 6,500 people had crossed the border by nightfall, officials said, many traveling to the frontier in buses provided by the Hungarian government.
Exhausted but jubilant refugees, many from war-battered Syria, were welcomed with food and blankets, and promised safe passage on to Germany, if that was their destination of choice.
"Thank God we are in Austria. Thank God we are finally safe. Thank God and everyone here," said an emotional Nasser Rihai, a merchant from Damascus, Syria. He had made a monthlong journey with his wife and two toddlers to reach this promised land — for now, a parking lot just across the frontier, where hundreds of migrants and refugees waited patiently behind metal barriers for buses that would take them to trains to continue on to Germany.
"This? From the Hungarian police," said Mohammed Dar, an engineering student from Damascus, fingering a purple bruise on the bridge of his nose as an evening chill descended on the damp day. "Here, the police smiled at me, and someone came over to ask me if I was warm enough."
By midafternoon, the first wave of this group of migrants began arriving in Germany, their hoped-for destination, on specially chartered trains. At the railway station in the southern German city of Munich, they flashed thumbs-up signs and raised their arms in celebration as residents greeted them with applause and gifts of bottled water, candy and stuffed animals for the children.
The Germans are trying to get things ready, turning warehouses and even the disused Tempelhof airport in Berlin into accommodations for people who, in the end, remain refugees driven from their homelands by war, persecution and poverty. There have been facilities specially built for them in some places too, and a bit of backlash, with protesters opposed to the influx burning down some sites.
And the standoff with the Hungarian government may not be over, let alone the monumental migrant crisis facing Europe, the biggest since World War II. More than 4 million Syrians have fled their country's grinding war.
A spokesman for Hungarian Prime Minister Viktor Orban said the buses provided by his government were a one-time measure sparked by concern that refugees who started walking Friday from Budapest toward the Austrian border about 100 miles away presented a safety hazard.
"That was an extraordinary situation when thousands of people started marching on one of the busiest not only Hungarian but international motorways, blocking traffic," Zoltan Kovacs, the spokesman, told the BBC.
The government buses had begun dropping asylum seekers off at the border with Austria in the early hours of Saturday. Many of them had been walking for hours, setting off on foot after authorities shut down the main railway station in Budapest, where the refugees had set up a tent city and waited for days to get out.
Austrian and German leaders said early Saturday that they would let refugees enter unimpeded from Hungary. That opened the floodgates.
The crowds included families with small children, pregnant women and elderly people in wheelchairs or walking with extreme difficulty. At the Austrian frontier, workers were on hand to help with supplies and words of encouragement.
Many of the refugees were expected to continue on to Vienna and then Germany. Munich was preparing for the arrival of thousands more over the next few days.
By midday Saturday, the sprawling encampment at Budapest's Keleti station had dwindled to a few hundred people, most of them hoping to get buses to the border. The numbers ebbed and flowed, as new arrivals streamed in and others left on foot to walk to Austria, in emulation of those who had gone before them.
Jalal Jawish, traveling with his wife and infant daughter, said their five-day sojourn in Hungary had been "horrible, the worst yet" in their long overland trek, preceded by a sea crossing from Turkey to Greece.
Jawish, from the Syrian city of Aleppo, said he was taken to a camp at Debrecen, outside Budapest. Authorities finally released the refugees after a near-riot, he said. He was hoping to be bused to Austria.
"The journey has been so bad," said 45-year-old electrician Hassan Mohamed, also from Aleppo. Sheltering first in Turkey, he had wondered whether he should make the voyage alone and then send for his family. But his wife and three school-age children refused, telling him, "We must live or die together."
Kovacs cited the "increasing resistance" of migrants and refugees to cooperating with Hungarian authorities who tried to register or send them to camps set up to process new arrivals. In what's become a bitter war of words, Kovacs continued to blame German humanitarianism for the mass movement of migrants through Hungary, following Berlin's pledge to welcome as many as 800,000 refugees fleeing war in Syria and other countries.
"The fundamental problem is still the pull factor that is being transmitted from Germany and Austria," he said, adding that Hungary was upholding its duty to protect the external borders of the European Union.
German Chancellor Angela Merkel insists that her country is doing no more and no less than its legal and moral duty in giving asylum seekers a fair hearing. If the people arriving in Europe are deemed to qualify for sanctuary, then it must be given.
"The right to political asylum has no limits on the number of asylum seekers," Merkel said in an interview published Saturday.
She said that Germany, Europe's biggest economy and home to 80 million people, had the "strength to do what is necessary."
The Hungarian government has come in for widespread criticism for its treatment of the refugees, who Orban says are unwanted because most are Muslims whose presence would threaten Europe's Christian identity.
On the side of the migrants, there was deep mistrust. After shutting down the railway station in Budapest, Hungarian authorities also essentially duped hundreds of migrants into boarding trains that they thought were heading to Austria and Germany but that instead took them to a camp about 20 miles away.
That raised suspicion among some refugees that the buses being organized by the government to take them to the border with Austria were another trap. But in the end, many boarded in hope, and found themselves getting to where they wanted to go: out of Hungary.
The group reaching Austria early Saturday may be just the beginning of a huge wave. An estimated 340,000 people fleeing the Middle East, Asia and Africa have crossed into Europe this year, with little sign that the numbers will abate anytime soon. More than 2,500 have died trying to cross the Mediterranean, U.N. officials estimate.
Thousands are traversing the Balkans and then spilling into Hungary on their way to Germany, which has pledged to accept more refugees than all of the other 27 EU countries combined. Hungary, by contrast, is building a fence with razor wire along its nearly 110-mile border with Serbia to keep migrants out.
Germany and France have called for a refugee quota system to distribute the burden more fairly among EU nations. But Central and Eastern European states such as Hungary, Poland and the Czech Republic oppose such measures.
King reported from Nickelsdorf and Chu from London. Special correspondent Amro Hassan in Nickelsdorf contributed to this report.