— Nations along Europe’s refugee route are taking the boldest steps yet to clamp down on migrant flows, trapping thousands of asylum seekers and potentially blocking countless war-weary families from finding sanctuary in the West.

The crackdown in recent days, aid groups say, comes at the worst possible time — just as new arrivals are rapidly increasing and the majority of migrants, once single men, are now women and children. An even larger surge from the Middle East and beyond is expected in the coming weeks, with tens of thousands more migrants set to land in Greece and start the long trek northwest to Europe’s core.

But crisis-weary countries from Austria to Macedonia are now moving to bar the doors. Since Sunday, Macedonia and Serbia, for instance, have blocked passage to virtually all Afghans — a group accounting for roughly a third of all migrants. Even many Syrians and Iraqis without proper documentation are being turned away, aid groups and U.N. officials say, leaving a quickly increasing number of desperate asylum seekers stranded in nearly bankrupt Greece.

There were other signs that the main route traversed by more than 1 million migrants last year was breaking down, with aid groups saying Croatia and Slovenia are also refusing entry to more asylum seekers. Slovenia’s parliament voted late Monday to dispatch the army for border control. And in yet another blow to the cherished ideal of free movement in Europe, Belgium said Tuesday that it would set up border controls on its frontier with France to block migrants recently cleared from a sprawling camp in Calais from entering its territory.

Afghans, meanwhile, were being stranded at various points along the 1,000-mile route from Athens to Vienna, as observers warned of an impending humanitarian crisis that could rival the peak of Europe’s refugee emergency this past fall.

“The situation isn’t good for us; there are no proper bathrooms or medical care. It’s very cold,” said Teimoorshah Yousefi, 40, one of 600 Afghans stranded at a northern Macedonian border crossing this week. He, along with his wife and two sons, ages 10 and 13, were being refused entry by Serbia. The family, he said, was getting frantic.

“I don’t know exactly what our final destination will be,” he said. “We want to go to any country that accepts us.”

In Europe, though, that list is getting shorter and shorter, and a war of words between nations was breaking out over the new rash of restrictions. Greece filed an official protest with Austria, which appeared to set off the domino effect of restrictions by introducing strict asylum caps last week. Athens decried what it called a “unilateral and non-friendly act” that could add a full-blown domestic refugee crisis to its already long list of financial woes. Germany and Austria also exchanged terse words.

On Tuesday, frustrated Greek police cleared hundreds of protesting Afghans from railroad tracks where they were staging a sit-in. In videos and photos, ­Afghan children held signs begging Macedonian authorities to “please help us cross border.”

“We’re going to see the backlog of people grow exponentially now, and you’ll have upward of 20,000 to 40,000 people getting stuck over the next few days,” said Kirk Day, Europe representative of the International Rescue Committee. “This is a continent that says it is founded on the principle of human rights,” he continued. “But right now, all we see is a race by countries that don’t want to be the last one to close their borders.”

Afghan migrants who have no permission to cross the border between Greece and Macedonia stay behind a fence near Gevgelija, Macedonia on Feb. 23. (Georgi Licovski/EPA)

Such countries say they have no choice, citing a building resentment against asylum seekers at home, overburdened refugee systems and heightened concerns that militant extremists are blending in with migrants. Already, more than 100,000 migrants have crossed the Mediterranean this year, far outpacing the same period in 2015. And yet, the Austrians and other nations enacting fresh controls say, Europe has failed to put in place a working plan to tackle the crisis, leaving them with no other option but to act.

On Wednesday, amid mounting criticism from the European Commission, Austria and other nations that are slapping new restrictions on migrants were set to meet to discuss the crisis. It remained unclear whether charges that some of the new moves may violate European and international law would compel those nations to change course.

“As long as there is no European solution, we will have to take national measures,” Austrian Foreign Minister Sebastian Kurz said in an interview published Tuesday by Germany’s Rheinische Post.

Indeed, Austria appears to have touched off the new round of border tightening, shocking many of its neighbors by introducing caps on Friday that limit the number of migrants who can enter and claim asylum there to 80 per day. It will also allow a maximum of 3,200 migrants a day to transit to Germany, the single-largest destination for asylum seekers.

Berlin immediately charged Vienna with effectively creating a pipeline that would funnel migrants to Germany while Austria shouldered little burden itself. At the same time, nations south of Austria scrambled to make sure blocked migrants would not get stuck on their territories.

The moves followed a little-noticed deal struck last week by the police services­ of Austria, Slovenia, Croatia, Serbia and Macedonia to get tougher on migrants.

The changes include the barring of asylum seekers who have lived for long periods in “safe” countries such as Turkey and Iran, a group that includes many Afghans, Iraqis and Syrians. On Tuesday, the U.N. High Commissioner for Refugees strongly condemned the new moves, warning of “the heightened likelihood of pushbacks, of people being stranded in the open, exposed to freezing cold weather and at risk of violence and exploitation at the hands of smugglers and traffickers.”

The new steps taken by Macedonia, however, marked only the latest in a string of measures meant to choke off the single-busiest migrant route. In November, Macedonia began barring all but Syrians, Iraqis and Afghans in an effort to weed out economic migrants. The decision now to exclude Afghans, critics say, is a dramatic escalation.

Not only are their numbers huge, but unlike migrants from North Africa and Pakistan, asylum seekers from Afghanistan have high acceptance rates in nations such as Germany — raising the prospect that legitimate refugees are now being restricted.

“The last I checked, peace had not suddenly come to Afghanistan,” Day said.

The move raised fears that more migrants would hire unscrupulous smugglers or risk the more dangerous routes out of Greece. In Bulgaria, for instance, migrants have been detained and beaten, while Albania presents rugged terrain that is harder to cross than Macedonia, where temporary visas were being granted so migrants could legally take trains and buses north.

Fear was also mounting that more migrants may switch back to the treacherous route to Europe that runs through violent Libya and across a far greater expanse of sea to Italy.

At the same time, pressure was growing in Germany for Chancellor Angela Merkel to drop what has been a humanitarian posture that did not set a limit on the number of asylum seekers her nation would accept. In recent days, Germans have watched as two viral videos showed more outbursts of anti-migrant rage. On Thursday, for instance, a busload of terrified migrants was surrounded by an angry German mob chanting “Go home” in the eastern city of Clausnitz.

Calls for a migrant cap in Germany — something activists say would amount to the final blow for asylum seekers — were growing.

“The federal government . . . has the clear responsibility to take care of border security and reinstate the rule of law,” Bavarian Justice Minister Winfried Bausback, a member of the Christian Social Union, sister party of Angela Merkel’s Christian Democrats, said Tuesday.

Stephanie Kirchner in Berlin and Elinda Labropoulou in Athens contributed to this report.

Read more:

Racial profiling seems to be a weapon in Europe’s war on terrorism

3 important facts about how the U.S. resettles Syrian refugees

Fear and paranoia lead Finns to form vigilante groups that ‘protect women’ from asylum seekers