BICSKE, Hungary — On Friday, this humble town in the Hungarian countryside 20 miles west of Budapest was nearly the scene of a tragedy.
Hundreds of migrants — women and children among them — chanted “SOS!” from the carriage of a commuter train as dozens of riot police swarmed around. The authorities’ message was clear: Unless the refugees surrendered, the police would storm the train.
Just 24 hours later, those same migrants were back at the station. But this time, the police had given them an escort, leading them through the town’s pastoral lanes as dogs barked and locals waved fond goodbyes.
Rather than threatening a potentially violent operation to keep the migrants inside Hungary, the police were dispatched to ensure that they left. Rather than fearing for their lives, the migrants were overcome with relief.
“I think the worst part of my journey is finally over,” said Mayssa, a gregarious and bright-eyed 32-year-old teacher who had been traveling for more than three weeks with her two children.
“I said to God, ‘Please help me,’ ” she said. “And now my God has helped me.”
Perhaps no place better encapsulates the topsy-turvy developments in Hungary in recent days than Bicske, an unassuming place that took on an oversized role in Europe’s burgeoning refugee crisis.
It started Thursday when a train pulled into the small station here and police ordered the hundreds of migrants who had clambered aboard in Budapest to get off. The migrants refused, saying they had been told the train was bound for Germany.
A standoff ensued, lasting through the night and deep into the following afternoon. It ended when the migrants relented: They walked off the train and were bused to a nearby refugee center, where they were forced to register.
The migrants feared that doing so would doom their chances of reaching their intended destination: the wealthier countries of northern Europe.
But in the end, it only set them back a day.
Late Friday night, it was the authorities who backed down after more than 1,000 refugees set off on foot from Budapest’s main railway station on an epic march toward the Austrian border.
At the camp here — a complex of low, white-washed buildings — refugees threatened Saturday to launch their own march toward the border. But police told them not to bother: There was a train waiting for them.
And so it was that an unusual parade wound through town Saturday afternoon, with police and refugees walking side by side in an impromptu, three-mile march to the same station where they had nearly clashed a day before.
If the police sensed the irony, they didn’t show it: They walked stone-faced the whole way.
The refugees, by contrast, could barely conceal their delight to be leaving a place they had never wanted to be in the first place.
“The police are no good here. The people in Hungary are very good — but they have no money,” said Samia Bakar, an exhausted-looking Syrian.
Her husband walked beside her with a pronounced limp: The police had beaten him with a wooden baton Thursday when, in a fit of desperation, he grabbed his wife and young child and flung them to the train tracks to keep from being carted off to the refugee center.
Mayssa, the teacher, didn’t have her husband with her: They had become separated in the chaos of Serbia, and he had pushed onward to Germany.
For days, she had ventured through forests and along roadsides clutching the hands of her 6-year-old son and 4-year-old daughter.
“I’m a very strong woman, and a very brave woman,” she said, proudly but not immodestly. “When I get to Germany, my husband must thank me very much.”
Like nearly everyone in the group, Mayssa, who asked that her last name not be published, said she had begun her journey in Syria.
She and her children walked with only the clothes they wore and a small paper bag filled with food.
In this town of neatly tended gardens and squat stucco homes, the residents — many of them elderly — peered out from behind curtains and came to the edge of their driveways to watch the spectacle. Some handed out bottles of water and loaves of bread.
When the station came into view, the refugees let out a few quick cheers, then bounded up the stairs to the platform and onto a northbound train.
As it pulled away, the migrants kept their eyes fixed on the green and gently rolling horizon beyond Bicske.
They did not look back.
Andras Petho contributed to this report.