KIEFERSFELDEN, Germany — A sleek black BMW with Austrian plates pulls up to a makeshift checkpoint, and German officers immediately flag it off the road. Both the driver and the passenger in the front seat are middle-aged men with dark skin, and the police have questions.

“The people seem to be from another place in the world,” Rainer Scharf, a federal police official from nearby Rosenheim, says as his colleagues conduct a search. “They could be from Austria, but we have to check this.”

The passengers turn out to be Austrian — citizens of the European Union who should, in theory, be able to cross the border unimpeded.

But border controls have returned to a continent that once exulted in transcending them, and with that shift, Europe has begun sacrificing its cherished ideal of free movement.

The man in the BMW’s passenger seat is 30-year-old Huseyin Yuksel, from the Austrian border town of Kufstein. He smiles when asked why he thought he was stopped. “It’s probably because I have dark hair,” he says with a laugh, though he is clearly annoyed, noting that this is a regular experience. “Eight out of 10 times,” he says.

The tightening of borders comes as a result of fears here about migration from North Africa and the Middle East. Even though the migrant crisis has largely been pushed outside the E.U., and the number of new arrivals has fallen to where it was before a historic influx in 2015, a cascade of nationalist anger has toppled governments from Rome to Vienna to Warsaw. Where nationalists have not won power, their influence has moved centrist governments to the right. That has been the case in France and, most recently, Germany. Chancellor Angela Merkel this month conceded to expanded border controls along the ­German-Austrian border to prevent the breakup of her governing coalition.

“We are in the process of abandoning, little by little, exception by exception, the original principle,” said Catherine Lalumière, France’s delegate to the 1985 discussions that laid the groundwork for free movement. “A ­Europe so proud of its humanist values is in the process of abandoning them altogether.”

Lalumière recalls that when diplomats from five European countries met in Schengen, Luxembourg, and agreed to gradually relax internal border checks, they were thinking primarily about making daily life easier for European citizens and businesses. “In signing the text, we did not believe it was the revolution of the century,” she said.

But as the European Union came into being and expanded, “Schengen” grew in geography and concept. The Schengen zone now encompasses 26 countries and nearly 400 million people. Passengers can board trains in Lisbon and arrive in Berlin without ever having to show a passport. And “Schengen” has come to symbolize a way of life: a chance to be born in Paris, marry in Rome, work in Munich, retire in Madrid.

This is also the way that many incoming refugees have imagined, and some would say romanticized, life on the continent.

“My idea of Europe was that there was free movement,” said Arif Abdullah Hadari, 19, who arrived in Munich from Afghanistan with his family in 2015. He now speaks nearly perfect German, having benefited from a language course provided by the German government after Merkel pledged to offer a “culture of welcome” to the nearly 1 million migrants and refugees she admitted in 2015.

Strictly speaking, the newly imposed border controls do not violate the Schengen Agreement. The text guarantees the right of individual governments to temporarily strengthen internal borders at any time. Furthermore, the agreement mainly protects the right of European citizens to move freely throughout the Schengen zone; the same right does not extend to foreign nationals without visas who merely find themselves on Schengen territory.

The migration issue has exposed the paradox at the heart of Schengen, which was never universal and which always protected the rights of certain people over others. When “aliens” refuse to leave the zone voluntarily, or when “it may be assumed that they will not do so,” the text stipulates that “they must be expelled from the territory of the contracting party in which they were apprehended.”

To some degree, Schengen itself empowers national authorities to subvert core European principles, such as the E.U.’s prohibition on “any discrimination based on any ground such as sex, race, color, ethnic or social origin.”

Security officials dispute that they resort to racial profiling in sorting the “aliens” from the Europeans, but some admit that skin color is among the “indications” they use.

“They can search everyone in the train, but it’s senseless to ask everyone,” said Scharf, the German federal police official. “If you see an elderly couple and see that they are tourists, that doesn’t make as much sense as searching people without baggage who come from Africa or Arabia.”

These checks, which allow authorities to make snap judgments about an individual’s national identity, are distressing to some of those who negotiated Schengen.

“To check people because they are black is racism,” Lalumière said. “No emergency justifies that kind of control.”

Security experts further say that such checks are ineffective at pinpointing security threats or even identifying who has the proper forms.

According to German federal police statistics from the first quarter of 2018, fewer than 1.2 percent of the 435,000 people who were checked in border regions or on trains lacked travel documents. “They’re measures that are completely disproportionate for what they’re intended for,” said Eric Töpfer, a policing and security expert at the German Institute for Human Rights.

The Schengen guidelines emphasize that the reintroduction of border controls should be limited in time and scope. Even so, there is little indication that the controls enacted since 2015 — for reasons of national security or party politics or both — are temporary.

France, for instance, has withdrawn a terrorism-related emergency provision that led to new border checks in 2015. But controls still exist along the border with Italy, where French authorities regularly detain ineligible asylum seekers and deposit them back on the Italian side.

It is likewise unclear how long the proposed checkpoints at Germany’s border with Austria will remain in place.

“Schengen will have to adapt and to take into account the new reality of politicians taking advantage of the challenges we face to push populist ideals,” said Pierre Vimont, France’s former ambassador to the E.U.

Some analysts suggest that instead of focusing on checkpoints to prevent migrants from traveling between E.U. countries, the E.U. needs to renegotiate the “Dublin regulation,” which requires asylum seekers to have their claims processed in the E.U. country where they first arrive. Southern European countries, where migrants from Africa and the Middle East tend to land, complain that they have had to shoulder a disproportionate responsibility.

“Chancellor Merkel calls on E.U. countries to show solidarity on migration. But the E.U. member states have essentially left Greece and Italy alone with the problem,” Töpfer said. “You don’t have to wonder why Greek border police simply wave migrants through.”

But renegotiating Dublin would be difficult. Countries such as Poland have resisted efforts to revisit the migrant question on an E.U.-wide basis, for fear of having to process and absorb more migrants themselves.

To many migrants and refugees, these are abstract discussions that have little to do with their experiences crossing more borders than they care to remember or count.

Abbas Najate, 43, a welder from Afghanistan, was sitting in a shelter in Rosenheim, not far from the Austrian border. His hand had been cut off by the Taliban, he said, because he is part of the Hazara ethnic group and a Shiite. He had escaped the Afghan war and lived in Iran for five years before coming to Germany. He said his application for asylum was rejected, but he recently appealed.

“People will still find a way to get through the border, even if they try to close it,” he said. “They will 100 percent find a way. They have no other home.”