Washington Post reporter Griff Witte details the events leading up to hundreds of migrants making the decision to walk 90 miles from Budapest to Austria on Friday. (Griff Witte and Ashleigh Joplin/The Washington Post)

Sending Europe’s refugee crisis hurtling toward another country, Hungary’s leaders on Friday backed down from a confrontation with thousands of asylum-seekers, offering to bus the desperate migrants to the border with Austria.

The late-night offer came after days of efforts to repel migrants fleeing war and poverty who have streamed into Hungary in a bid to reach Western Europe, where they hope to begin new lives. Hungarian Prime Minister Viktor Orban had painted his hard-line approach against the mostly Muslim asylum-seekers as a stand to preserve Europe as a Christian continent.

But after a column of migrants more than a mile long streamed onto Hungary’s main highway to Austria, it appeared that authorities felt they had no alternative but to pass the challenge to their neighbor, another country that has been ambivalent about the influx.

By early Saturday morning, the first asylum seekers began to walk across the border into Austria after having been dropped off by buses on the Hungarian side. The buses had picked people up at Budapest's main train station. After initial hesitation, the crowds began to climb on board, relieved to be en route out of Hungary. 

At Keleti train station in Budapest, where thousands of migrants had camped out for nearly a week, the central plaza was nearly empty on Saturday morning except for a maintenance crew hosing down the site.

The Hungarian decision to provide up to 100 buses to take the asylum-seekers to the border did little to resolve the challenge facing Europe, which has failed to come up with a unified response to the mounting numbers on its borders. Instead, the plans simply shifted the crisis to another state, leaving the fundamental problem — a bloc of 503 million people unable to agree whether and how to house several hundred thousand refugees — to burn for another day.

“The European Union has proved to be inadequate to address the situation,” Janos Lazar, the Hungarian prime minister’s chief of staff, said in an address in parliament. He said that the decision had been made to clear the roads to ensure the country’s transportation security.

Austrian Chancellor Werner Faymann said that he and German Chancellor Angela Merkel had agreed to take in the asylum-seekers that Hungary was moving to the border.

“On the basis of today’s emergency at the Hungarian border, Austria and Germany are allowing an onward journey of the refugees into their countries in this instance,” Faymann said in a statement on his Facebook page. But he suggested that it was a one-time agreement, leaving the broader issue unresolved

In recent days, Hungarian authorities had tried to halt the asylum-seekers’ journey by stopping rail traffic, penning them in migrant camps and bolstering security at the border. A tense day-long standoff on a halted train about 20 miles west of Budapest ended after many of the train’s occupants stormed police lines and walked to the highway to join a larger group that had already started out from Budapest. Others — mostly women and children — agreed to go to a nearby migration processing camp.

More than 1,000 asylum-seekers walked on the shoulder of the highway as trucks whizzed by Friday night. Fathers carried sleeping toddlers on their shoulders. Old men hobbled on canes. Near the front of the crowd, one man waved a blue and gold European Union flag.

“There’s no train, there’s no plane, there’s no taxi, there’s no one to help us, so this is the only way,” said Hala Kaman, 30, a dentist from Damascus, who had been pushing her 3-year-old son in a stroller for eight hours by late Friday. Her 10-year-old daughter and 6-year-old son walked alongside. Kaman said she hoped to go to Sweden, where authorities have promised permanent residency to Syrian refugees.

Her daughter sobbed beside her, saying she was exhausted.

“I know,” Kaman said, “but we have to keep going.”

Amid the chaos, the debate over how to respond to Europe’s refugee crisis continued to escalate. Hungarian lawmakers, fearful of the influx of asylum-seekers from conflict-torn Middle Eastern nations, approved measures Friday that gave authorities sweeping powers to seal the border and detain migrants who crossed the 108-mile razor-wire fence that was recently erected across the frontier with Serbia.

“The reality is that Europe is threatened by a mass inflow of people. Many tens of millions of people could come to Europe,” Orban said Friday on Hungarian national radio.

“Now we talk about hundreds of thousands, but next year we will talk about millions, and there is no end to this,” the prime minister said. “All of a sudden we will see that we are in a minority in our own continent.”

Hungarian leaders had said they were simply following E.U. regulations in their harsh response, so tough that they declined U.N. offers of emergency aid for the migrants. But the rules have proved radically inadequate for the situation because they place most of the burden of dealing with asylum-seekers on the first E.U. country they enter. That has forced poorer countries such as Greece, Hungary and Italy to the forefront as many richer ones have taken a back seat.

The vast majority of asylum-seekers arriving in Hungary simply want to move on to Germany and Sweden, but leaders there have said they cannot shoulder the full burden of the arrivals. Instead, migrants have gathered in the subterranean passages near Budapest’s main train station as they plot their next move.

Hungary’s nationalist government enjoys broad public support. But not all citizens are opposed to the asylum-seekers.

“My stomach is shaking when I see these little kids,” said Attila Gadl, who drove his minivan to the roadside to hand out loaves of bread, water and reflective vests to the crowds straggling by.

Many countries have refused to commit to mandatory targets for taking in refugees. Central European leaders convening in Prague said they would not support a joint German and French proposal to institute quotas that would require each European Union nation to take a designated number of refugees. Many nations have been less willing to accept asylum-seekers than Germany, which has said it expects 800,000 this year. Slovakia, for example, has said it will take only Christians.

On Friday, British Prime Minister David Cameron reversed a pledge not to take more refugees, citing “the scale of the crisis and the suffering of people.”

He said that his nation would accept “thousands” from the packed camps in Lebanon, Turkey and Jordan, where millions of people have been displaced by Syria’s civil war, and that he would offer more details next week.

The package of measures approved Friday by Hungary’s parliament made crossing or damaging the border fence a criminal offense, punishable by up to three years in prison. Hungarian authorities will also be able to set up migrant camps at the frontier, where asylum-seekers can be confined as their requests are processed. Orban aims to seal the border by Sept. 15.

The pressure is rapidly building as record numbers of asylum-seekers reach Europe’s shores faster than authorities can decide what to do with them. Riots broke out Friday on the Greek island of Lesvos, where more than 1,000 migrants tried to board a packed ferry for mainland Greece. Police used stun grenades to push them back. Authorities think that more than 15,000 asylum-seekers are on the tourist island, but there are facilities for far fewer.

The U.N. refugee agency said Friday that nearly 5,600 people crossed from Greece to Macedonia a day earlier, double the figures that had been seen in recent days. Those numbers were already unprecedented.

“The only ones who benefit from the lack of a common European response are the smugglers and traffickers who are making profit from people’s desperation to reach safety,” U.N. High Commissioner for Refugees António Guterres said Friday in a statement. He said Europe needed to make as many as 200,000 spots for new refugees. Plans circulating in Brussels appear far less generous.

The drowning death of a Syrian toddler, 3-year-old Aylan Kurdi, galvanized global emotions this week after images of his body washing up on a Turkish coast went viral. He was buried Friday alongside his mother, Rehan, and brother, Ghalib, in their native Kobane.

Despite Europe’s harsh reception, many asylum-seekers said they remained optimistic.

“I will get there. I need this,” said Fatima Hamido, 24, an art and English teacher in her native Latakia, Syria, who nearly made it to the Austrian border in a smuggler’s van before it broke down and Hungarian authorities brought her back to a camp near Budapest. “This is the only way.”

Birnbaum reported from Brussels. Karla Adam in London and Andras Petho in Budapest contributed to this report.

Read more:

The Arab world’s wealthiest nations are doing next to nothing for Syria’s refugees

As tragedies shock Europe, a bigger refugee crisis looms in Middle East

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

‘People in Europe are full of fear’ over refugee influx