Thousands of exhausted, surprised and relieved migrants reached Austria early on Saturday, clambering off a fleet of Hungarian buses to find a warm welcome from charity workers offering beds and hot tea.
The pre-dawn move eased immediate pressure on Hungary, which has struggled to manage the flow of thousands of migrants arriving daily from non-EU member Serbia.
But officials warned that the human tide south of Hungary was still rising, and more westward-bound travellers continued to arrive in Budapest within hours of the mass evacuation of the capital's central rail station.
Austrian police spokesman Helmut Marban told reporters that about 4,000 migrants had crossed into Austria from Hungary by mid-morning. About 800 people had already arrived in Vienna and then left on Germany-bound trains, said Vienna official Wolfgan Mueller.
He estimates that about 3,000 migrants would come to Vienna from the border during the day.
Hungary relented in its demand for the travellers to report to government-run asylum centres when challenged by defiant migrants largely from Syria, Iraq and Afghanistan.
Thousands marched west Friday from the Keleti train station along Hungary's major motorway and camped overnight in the rain by the roadside.
Hundreds more broke through police lines at a train station in the western town of Bicske, where police were trying to take them to a refugee camp, and blocked the main rail line as they, too, marched west.
Austria and Germany made the breakthrough possible by announcing they would take responsibility for the mass of humanity that was already on the move west or camped out in their thousands at Keleti.
Hungary on Tuesday had suspended train services from that station to Austria and Germany, compounding the build-up of migrants there, in a futile bid to try to make the visitors file asylum papers in Hungary.
Austrian Federal Railways said the arriving migrants, once they passed through hastily assembled border shelters and refreshments, were being placed on trains to the capital, Vienna, and the city of Salzburg.
The first 400 migrants arrived on a train into Vienna, where charity workers provided them a battery of supplies displayed in separately labeled shopping carts containing food, water and packages of hygiene products for men and women.
A mixed crowd of migrants' friends and Austrian onlookers cheered their arrival, with many shouting "Welcome!" in both German and Arabic. One Austrian woman pulled from her handbag a pair of children's rubber rain boots and handed them to a Middle Eastern woman carrying a small boy.
"Austria is very good," said Merhan Harshiri, a 23-year-old Iraqi who smiled broadly as he walked toward the supply line, where newcomers munched apples and bananas. "We have been treated very well by Austrian police."
Earlier in jubilant scenes on the border, hundreds of migrants bearing blankets over their shoulders to provide cover from heavy rains walked off from buses and into Austria, where volunteers at a roadside Red Cross shelter offered them hot tea and handshakes of welcome. Many migrants collapsed in exhaustion on the floor, but with obvious relief etched on their faces.
Many had been awoken by friends at Keleti around midnight with news many didn't want to believe after days of deadlock: Hungary was granting their demand to be allowed to reach Austria and, for many, onward travel to Germany. Many feared that the scores of buses assembling at the terminal instead would take them to Hungarian camps for asylum seekers, as the government previously insisted must happen.
The travelers in many cases have spent months in Turkish refugee camps, taken long journeys by boat, train and foot through Greece and the Balkans, then crawled under barbed wire on Hungary's southern frontier to a frosty welcome. While Austria says it will offer the newcomers asylum opportunities, most say they want to settle in Germany.
Since Tuesday morning, Hungarian authorities had refused to let them board trains to the west, and the migrants balked at going to processing centers, fearing they would face deportation or indefinite detention in Hungary. Government officials said they changed course because Hungary's systems were becoming overwhelmed by the sheer numbers.
Janos Lazar, chief of staff to Hungary's prime minister, said the migrants' surprise movements Friday were imperiling rail services and causing massive traffic jams. "Transportation safety can't be put at risk," he said.
In Berlin, German officials said they felt it was necessary to take responsibility given Hungary's apparent inability to manage the challenge. But they emphasised that Hungary, as an EU member and first port of call for many migrants, needed to do more to ensure that new arrivals filed for asylum there rather than travel deeper into Europe.
"Because of the emergency situation on the Hungarian border, Austria and Germany have agreed to allow the refugees to travel onward in this case," German government spokesman Georg Streiter told The Associated Press.
"It's an attempt to help solve an emergency situation. But we continue to expect Hungary to meet its European obligations."