Afghan asylum seeker Shakira Sarwari, 27, and her two children, Mohammed, 17 months, and Setayesh, 7, are taken off a Munich-bound train in Salzburg, Austria, by German police. (Anthony Faiola/The Washington Post)

The 5:08 p.m. to Munich pulled into Salzburg Central Station, and four German police officers boarded the train. This was a migrant sweep, and the cops moved quickly past the fair-skinned passengers, questioning a group of Saudi tourists and a Chicano from Chicago.

In the last seat of the last car, the patrol found Shakira Sarwari. Eight months on the road from war-torn Kandahar, the young Afghan mother clung tightly to her 17-month-old son. Her 7-year-old daughter huddled close, nervously eying the officers. They were now one station away from their final destination: Germany, the promised land of refugees.

But they were not there yet — and after more than a million arrivals in 2015, the German welcome is no longer so warm. In fact, a crackdown at the border is giving those migrants who make it this far the worst odds of crossing since the height of the crisis last year. It is more evidence, some say, that as Europe’s migrant crisis stokes a mounting voter backlash, even generous Germany is quietly closing its door.

“Your passport,” asked one of the officers, who now have permission from the Austrians to stop migrants on trains bound for Germany.

Sarwari replied with a pleading look, holding up an empty palm.

German police board a train in Salzburg, Austria, for a migrant sweep. (Anthony Faiola/The Washington Post)

“Where are you going?” the officer asked slowly. Sarwari tugged nervously at her pink headscarf. In her arms, her son squirmed and whined. Her daughter, terrified, was on the verge of tears.

“To Germany,” Sarwari said. “To Germany.”

The officer shook his head.

“You’ll have to come with us,” he said.

In September 2015, as thousands of migrants a day were converging on Europe, German Chancellor Angela Merkel issued an astounding pledge. In the face of raging wars in the Middle East, she said there was “no limit” to the number of refugees Germany could accept. That promise — along with some of the most generous refugee benefits in the world — made the same country that sparked World War II an asylum seeker’s paradise.

But that has already begun to change. Since March, tougher controls in the Balkans, Greece and Turkey have sharply reduced the number of new arrivals. But hundreds of migrants each week — mostly from Syria, Iraq, Afghanistan and Africa — are still attempting to enter Germany.

Yet the nation that took in more migrants last year than the rest of Europe combined is making it harder to get in. In August, Germany refused entry to 1,070 of the 2,300 migrants — or 46 percent — it stopped on its side of the Austrian border. In January, when arrival numbers were far higher, only 7 percent of migrants were turned back.

The smaller number of arrivals now, German officials say, has allowed them to more rigorously question migrants and apply rules meant to weed out economic migrants and opportunists. But critics say the policy is too sweeping and that there’s a good chance that people who qualify for German asylum are not being given a chance to apply. A large portion of those coming now also already have family in Germany and are trying to skirt years-long waiting periods for family reunions.

Yet the German message to migrants is clear: It’s not so easy anymore.

“The reality of today’s Germany is a different one than the refugee fairy tale of last summer,” said Karl Kopp, spokesman for the migrant aid group Pro Asyl.

It happens as Germany is drowning in a backlog of hundreds of thousands of asylum requests. Last year, it paid $5.91 billion in aid and shelter, more than double the cost in 2014. A violent standoff last week between migrants and right-wing Germans became the latest sign of rising tensions. Germans are investigating 60 cases of migrants allegedly conspiring with Islamist militants.

Perhaps the most important factor: The chancellor’s Christian Democratic Union is suffering steep political losses because of her refugee stance, losing ground in a string of local elections and surrendering voters to the anti-migrant Alternative for Germany party only a year before Merkel’s possible reelection bid. After another bitter defeat in liberal Berlin, Merkel this week offered a mea culpa.

“If I could, I would turn back time many, many years in order to be able to better prepare myself, the whole government and all those responsible, for the situation that hit us rather unexpectedly in late summer of 2015,” she said.

Germany is now rejecting more than a third of all asylum applications for those already there, and it is trying to negotiate mass returns to countries such as Afghanistan. The tough-talking interior minister, Thomas de Maizière, has even suggested that Germany wants to send many refugees back to bankrupt Greece, where most of them first entered Europe.

In the graceful city of Salzburg — the birthplace of Mozart that last year turned into the main gateway into Germany for migrants — German police are going further. Since June, they have been boarding trains here to pull off irregular migrants with Austria’s blessing. Some migrants are briefly detained in Austrian jails. Most get 14 days to leave the country or apply for asylum in Austria. Still others could get pushed back by the Austrians to Italy or Slovenia.

It is all part, observers say, of Europe’s closing door.

As the German police led Shakira Sarwari off the train in Salzburg, her daughter, Setayesh, dressed inpink sneakers and an Elsa shirt from Disney’s “Frozen,” broke down in tears. In the busy terminal, and flanked by officers, they walked past gawking passengers as Sarwari tried to comfort her crying son.

“Shh, shh,” she said softly, cradling Mohammed in her arms.

The German police showed the three of them into an industrial-looking room fitted with a computer terminal, a few wooden desks and a bench behind a partial fence. She went behind the fence with a male officer, who did a cursory check. She placidly complied when he asked her to remove her headscarf. Mohammed cried as the police took his mother’s digital fingerprints.

As requested, she emptied her possessions onto a table — the most important being a plastic bag with a few hundred euros, all that she had left. She flushed as she was presented with, and asked to sign, a document in her native Pashtun language stating that she was being denied entry to Germany. She would later tell an interpreter that she could not read or write.

Via a telephone interpreter, she was able to communicate with the police, telling them that her husband was already in Germany and she was trying to join him there.

“I want to go to Germany,” she said.

“You cannot go,” an officer explained. “Because of European law.” She was told she would need to stay in Austria.

“I do not want to stay here,” she said, shaking her head. “My husband is in Germany.”

Her girl could not stop crying now. One of the German officers, Horst Auerbach, gave her daughter a gentle look and a glass of water.

“It gets to you,” he said, a lump in his throat.

Within two hours, the family was handed over to the Austrian police. A sturdy female cop with plastic gloves took Sarwari away for a more thorough search. Afterward, the family spent the night at the main Salzburg police station.

The next morning, like most migrants taken off the trains here, she was issued an order to leave the country or apply for asylum in Austria. Some Austrian politicians are bitterly complaining that the German policy is leaving more migrants on Austria’s doorstep — although Austria, too, is trying to send some migrants back to Italy and Slovenia. Officials in Vienna say both they and the Germans are simply following European rules.

It remains unclear how efficient the German measures are at thwarting migrants. All the migrants in Salzburg are indeed being stopped. But farther north, at other border crossings, more asylum seekers are managing to get across the German border, where German officers decide whether to push them back. Almost half are refused. Decisions, officials say, are made on a case-by-case basis.

As Sarwari prepared to leave the police station, she said she had no real plan. She did not speak German or English. She did not know which way to go.

“I made it this far by myself, with the kids, and I am going to go to Germany,” she said, determined. “I will manage to find a way.”

Stephanie Kirchner contributed to this report.