Scores of migrants have broken through a police line near a refugee centre and marched against oncoming traffic on a motorway, headed for Budapest.
The group of around 200 walked about 15 kilometres along the hard shoulder of the M5 motorway before police negotiators persuaded them to board buses to take them back to a nearby registration camp for asylum-seekers.
Police earlier closed a section of the motorway near Roszke in southeast Hungary close to the Serbian border after the group climbed over a barrier and on to the road, which leads to the capital.
The migrants were part of a 1000-strong crowd who had earlier pushed past a police line at a refugee collection point at Roszke, the first stop before people are brought to the registration camp.
There were scuffles throughout Monday as migrants chanting "Freedom!" protested at having to wait for hours in the open for buses to take them for registration.
Clashes have broken out between police and migrants, sick of the long delays at the overcrowded refugee collection and registration camp at Roszke, the main crossing point for the thousands of people who have been coming into Hungary every day for the past month.
Police fired tear gas at migrants after some threw stones at officials at the registration camp on Friday.
About 300 migrants had escaped from the camp earlier, forcing the authorities to close the main border crossing with Serbia for around an hour, although they were later caught by police.
Around 167,000 migrants have entered Hungary illegally so far this year, with most crossing the border around the Roszke area.
Last Friday, among a raft of anti-migrant laws approved, Hungary's parliament voted to criminalise illegal border crossing, with the ruling expected to come into force September 15.