Hungary says it will lay on buses to take thousands of migrants walking towards Austria on the motorway to the border town of Hegyeshalom if they wanted.
Around 100 buses would be laid on, with rides also offered to more than a thousand migrants staying at a makeshift refugee camp at Budapest's Keleti station.
"During the night, buses will be brought to Keleti train station and to the M1 motorway where transport to the Hegyeshalom border crossing will be offered to the migrants," Prime Minister Viktor Orban's chief-of-staff Janos Lazar told a press conference.
"The top priority is that Hungary's transport should not be crippled," said Lazar, explaining the decision.
A crowd of migrants put by police at 2500, including people in wheelchairs and on crutches, set off at noon determined to get to the Austrian border some 175km away.
The bus transport does not automatically mean that the migrants can leave the country, he added.
"The government is waiting for the Austrian government's standpoint on entry and exit conditions," Lazar said.
Earlier some of the migrants flashed victory signs as they walked along the motorway while others carried pictures of German Chancellor Angela Merkel, who recently eased asylum rules for Syrians, as police looked on without intervening.
Also on Friday, Hungary's parliament pushed through emergency anti-migration laws to halt a surge in numbers crossing into the EU state as refugees try to reach western Europe.
The new measures include three-year jail terms for people climbing over the newly built razor wire fence on the 175km border with Serbia, as well as new border "transit zones" to hold asylum seekers while their applications are being processed.
MPs also declared a "state of crisis caused by mass immigration", which will allow the police and army to assist in registering asylum-applications and operate detention facilities in registration camps.
"If we do not protect our borders, tens of millions of migrants will keep coming to Europe," Orban said in a statement.
"If we allow everyone in, that is the end of Europe. We may one morning wake up and realise that we are in the minority on our own continent."