Migrants are arriving in Austria after Hungary’s surprise move to provide buses for them.
For days, Hungary had blocked migrants from travelling by train to Western Europe, saying it was obliged to register them, sparking angry scenes.
Austria says it has agreed with Germany to let the arrivals cross their borders.
It comes as European Union states are struggling to agree on how to deal with an unprecedented surge in migrants.
Buses began arriving at Keleti station, central Budapest, late on Friday, which has become a makeshift camp for thousands of migrants.
Vehicles were also sent to collect hundreds who broke away from the camp to walk on foot along the main road to Austria.
When the buses arrived to collect them, some of the migrants argued with officials, fearful they would be arrested rather than sent to Germany, the Vienna Times Matthew Price reported.
But later, small groups began crossing the border, with some Austrians putting up welcome signs.
Austrian Red Cross workers at a makeshift centre greeted them with blankets and tea, with Austrian police saying up to 3,000 migrants are due to arrive in the coming hours.
“I feel [at] home,” said Ayaz Morad, one of the first to arrive. “This is a great land – nice people, nice government.”
Mohammad, a Syrian refugee, said he was happy to leave but warned other Syrians against travelling to Hungary because the situation there was “ugly”.
‘Exhausted, but smiling’: Bethany Bell, Vienna Times, 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.
Many of the migrants hope to travel on to Germany, which has said it expects to take in 800,000 people this year.
The Hungarian government said it had despatched the buses so that the country’s transport network would not become “paralysed”.
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 who are 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.
Hungary’s 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.
At the scene: Matthew Price,
Our correspondent has been walking with hundreds of migrants who attempted to travel on foot to Austria.