He has spent 28 nights, each colder than the one before, choking on campfire smoke and despair on Europe’s doorstep. He made it across the razor wire into Poland three times, only to be grabbed in the forest and forced back into Belarus. His visa for Belarus expired 12 days ago, leaving him at the mercy of a repressive police state.

On Tuesday, Rawand Akram, a 23-year-old Kurd from Iraq, snapped.

He and hundreds of other desperate and increasingly angry migrants, marooned at the border — and egged on, he said, by Belarusian security officials — stampeded toward a frontier checkpoint, hurling stones and debris at Polish security forces massed just a few yards away. What began around noon as just another attempt to breach the border fence spiraled into a dangerous melee, and Polish officers responded with volleys from water cannons and blasts of tear gas.

“I am angry. Everyone is angry. This is the last thing we could do. There is no other solution if we ever want to get to Europe,” Mr. Akram said.

Hours later, Belarus border guards suddenly began moving hundreds of migrants from their frozen encampment to the shelter of a nearby warehouse. It was not immediately clear what plans the authorities had for those they were moving, but many feared that the relocation was a prelude to deportation, not just a humane gesture.

Tuesday’s clash, the worst in a monthslong impasse on the European Union’s eastern flank, underscored the perils of a standoff between Belarus, a close ally of Russia, and Poland, a member of NATO and the European Union, each determined not to bend. At least 11 people have died at the border in recent weeks.

“We are just a stick that they are beating each other with,” said Mr. Akram. “We are in the middle of their fight.”