A group of around 300 migrants, many from Syria, abandoned their struggle to to walk the Hungarian capital Budapest on Monday night.
Desperate and exhausted the men, women and children had walked between 15 and 20km before giving up. Many simply lay down at the side of the road, unable or unwilling to go any further.
The highway was closed to traffic for for more than four hours.
Some eventually agreed to get on buses to take them back to a reception centre at Roszke near the border, from where they had broken out earlier in the day.
Groups of migrants had scuffled with police and, despite the authorities using pepper spray, many managed to break through the cordon.
They set off down the wrong side of the motorway headed for the capital.
20,000 migrants are reported to have entered Germany from Hungary over the weekend alone, prompting German Chancellor Angela Merkel to describe the ongoing influx as “breathtaking”.
But Merkel added that the crisis was manageable and urged European partners to do more to help.