"Germany! Germany!," the crowd chanted outside Keleti station. "We want to leave!" and "Merkel!", they cried, referring to the German chancellor. Some held babies as well as train tickets aloft.
The crowd later calmed down and several hundred people — men, women and children — remained outside in the baking sun, many sitting on the ground and in the streets around as police blocked entrances to the station.
The station later reopened but only for non-migrants, an AFP reporter at the scene said, with police only letting people in who had tickets, ID cards and relevant visas.
"Go down, get out, go down the steps now!" one police man shouted in English at the entrance to the station at a large family from Syria or Iraq who included a woman in a wheelchair.
"I am really pissed off. Why can't the Hungarians just let us go," one Afghan migrant, Haider, 31, told AFP after ripping up his ticket. "I worked as a translator for the US army for four years. I got here at 5:00 am (0300 GMT)."
An earlier public tannoy announcement at the train station, which has been packed with migrants for several weeks, said no trains would be leaving or arriving "until further notice" and asking everyone to leave.
Some migrants then began shouting as hundreds of police, some of them riot officers, began moving people out although they offered no resistance and there were no clashes.
The announcement came after around 500 migrants tried to board the 9:10 am (0710 GMT) train to Vienna, the AFP reporter said.
In August alone, 50,000 migrants, mostly from hotspots such as Syria, Iraq and Afghanistan, entered European Union member Hungary.
Most then seek to travel onwards to western European countries, particularly Germany.
Hungary — part of Europe's visa-free Schengen zone — had previously insisted that EU rules prevent them from letting visa-less migrants travel onwards to the west.
Frustrated refugees, pouring into Hungary at a rate of over 2,000 a day during August, were left to set up ever-growing makeshift camps outside the two main stations in Budapest.
A total of 3,650 migrants — lots of young men but also large numbers of families with small, exhausted children and a few old people — reached Vienna by train Monday, this year's biggest daily number, Austrian police said.
Most then got on trains going to Germany.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ