Hundreds of migrants have been protesting outside a major railway station in the Hungarian capital after police sealed off the terminal to stop them travelling through the EU.
Crowds of people chanted “Germany” and waved train tickets after being forced to leave Keleti station in Budapest.
Hungary is trying to restore order and enforce EU rules, officials said.
Meanwhile, German Chancellor Angela Merkel has called for the fair distribution of refugees across Europe.
Austrian police said 3,650 migrants arrived in the Austrian capital, Vienna, from Hungary on Monday, with most heading for Germany.
Hungarian officials had earlier appeared to abandon efforts to register them under EU rules, which say they should seek asylum in the first EU country they enter, correspondents say.
About 1,000 migrants congregated outside Keleti station, in the east of the city, as it was evacuated on Tuesday.
It was closed briefly and public announcements said no trains would be leaving.
But it soon reopened to non-migrant passengers, with lines of police preventing migrants from going through the main entrance.
There are scenes of mayhem at the station, with hundreds of migrants circling the area trying to find a way through the guarded entrances, reports the BBC’s Nick Thorpe in Budapest.
The decision to allow refugees to board trains on Monday evening and early on Tuesday seems to have been a temporary one to ease the growing pressure at the station, he adds.
Image caption Migrants wave their train tickets outside Keleti station Image caption Hungarian police briefly closed the station Image caption These Syrian refugees arrived in Vienna on Tuesday on a train from Budapest
On Tuesday, hundreds of migrants had tried to board services to Austria and Germany.
Some complained that they had paid hundreds of euros for tickets, and called for the station to be reopened so that they could continue their journey.
Many of the migrants have been waiting at Keleti station for days. Reporters said they are mainly Syrians, Afghans and Eritreans.