Hungary says it will transport thousands of migrants by bus to the border with Austria.
It comes after crowds of people broke away from riot police and began walking to Vienna.
Those on foot will be picked up, along with the many others who are camped out at Budapest’s main railway station.
On Facebook, Austria’s Chancellor said his country – along with Germany – will allow them into their territories.
The move in Hungary by the government of right-wing Prime Minister Viktor Orban appears to mark a climbdown in the face of overwhelming numbers of people – and rising tensions.
For days, Budapest has cancelled all trains going west to Austria and Germany.
It said it had to stick to EU rules which dictate that migrants register in the first country they reach and stay there until their asylum requests are processed.
But most migrants do not want to be in Hungary. They are desperate to get to northern and western Europe.