Hungarian police halted a train packed with migrants and refugees who thought they were bound for the Austrian border, and tried to force them to disembark in a town with a detention camp.

Disappointed migrants started chanting "No camp!" Some tried to flee on foot down the tracks, and one family threw themselves onto the tracks and appealed to journalists for help. Police in helmets and body armour moved in and lifted the man off of his wife and child. Officers later handcuffed and carried him away. The woman and infant were escorted off the tracks but not detained.

Other migrants scuffled with police and forced their way back on to the train's carriages, where a stand-off in the sweltering sun began.

Police delivered water to the migrants, but many tossed the bottles back, expressing fears that police might have spiked the water and wanted to sedate them.

Hungarian police then forced journalists and photographers away from the scene.

The train's departure from Budapest followed a two-day standoff with police barring entry to the station to more than 2,000 migrants. Eventually the police stepped aside and the crowd surged past. Some were wary of boarding trains, unsure where they were headed. "We want to go to Germany but that train in the station, maybe it goes nowhere. We heard it may go to a camp. So we will stay out here and wait," said a 17-year-old Syrian.

The hundreds who boarded the train crammed aboard, clinging to doors and squeezing their children through open carriage windows.

But instead of proceeding to the Austrian border, the train was stopped just west of Budapest in the town of Bicske, where Hungary has a migration reception centre. Many of the migrants and refugees on the train had left the overcrowded asylum detention centre just days before.