Thousands of migrants have crossed into Austria, after Hungary’s surprise decision to provide buses to take them to the border overnight.
For days, the Hungarian government had blocked them from travelling by train to northern and western Europe.
About 4,000 exhausted people, many of whom had initially fled Syria, crossed the Austrian border and are being received in a Red Cross Centre.
Austria says they can claim asylum or carry on to Germany if they wish.
The move comes as European Union countries are struggling to agree on how to deal with an unprecedented surge of asylum seekers.
Hungary’s government eased restrictions on transit after many migrants overwhelmed police cordons and set off towards the border on foot on Friday.
Buses began picking up migrants from Keleti station in central Budapest, where thousands had been camped.
Vehicles were also sent to take those who had decided to walk along a motorway to Austria.
On Saturday Hungarian government spokesman Zoltan Kovacs told the BBC there would be no more buses or trains to take the migrants on to Austria.
He said the transport had been arranged as a one-off, because of fears for the migrants’ safety.
On Saturday morning about 200 people remained at Keleti station, where a major clean-up was under way.
When the buses arrived, some of the migrants argued with officials, fearful they would be arrested rather than sent to Germany, the BBC’s Matthew Price reported.
But early on Saturday, groups began crossing the border on foot. Some Austrians displayed welcome signs.
Austrian Red Cross workers at a makeshift centre greeted them with blankets and tea.
“I feel [at] home,” said Ayaz Morad, one of the first to arrive. “This is a great land – nice people, nice government.”
The migrants are now being taken by train from the Austrian border town of Nickelsdorf to the capital Vienna.
Many hope to travel on to Germany, which says it expects 6,000 people to arrive over the weekend.
‘Exhausted, but smiling’: Bethany Bell, BBC News, Austrian-Hungarian border
They crossed into Austria on foot – the Hungarian buses stopped before reaching the border and they had to walk the final stretch.
There were children and at least one man in a wheelchair.
They were exhausted. Some of them were limping, but many were smiling broadly – relieved to have finally left Hungary.
“Where are we?” one man shouted. “Austria,” I replied. “Good,” he said.
Germany has said it expects to take in 800,000 people this year.
Austria’s Chancellor Werner Faymann said that after talks with his German counterpart Angela Merkel, the two countries would allow in the migrants due to the “emergency situation” in Hungary.
But he said he expected Hungary to respect any EU quotas for asylum seekers – something Hungary, along with the Czech Republic, Poland and Slovakia, has rejected.
Hungary has become a major transit nation for people fleeing the Middle East and Africa, and seeking to reach north and west Europe.
The Hungarian parliament on Friday approved tougher border controls and penalties for migrants, underlining divisions within the EU on how to tackle the crisis.
Hungarian Prime Minister Viktor Orban has said the surge in arrivals was “Germany’s problem”, since that was where most people wanted to go.
But Chancellor Merkel has called for refugees to be fairly divided among EU members.