BERLIN—Last Thursday morning, police officers caught up with a 28-year-old German lieutenant now known as Franco A. at a military installation near Hammelburg, a tiny city in Bavaria, where he was in the middle of a commando exercise. They pulled him out of a hole in the ground. The training course for lone fighters brags about the ability of its obstacle course to “bring participants to their physical and psychological limits”—and even before questioning, the lieutenant was, according to the officers, “physically exhausted.”

In fact, there was more going on than that. One can hardly wonder that Franco A. was worn out. He had been leading an extraordinary double—or one might say triple—life. Part of his time was spent as a model soldier, part as a right-wing extremist, and part as a bogus Syrian refugee under the alias of “David Benjamin,” who applied for asylum in Germany with nothing but a beginner’s course in Arabic and a stubble beard.

Police suspect he may have been plotting a “false flag” terror attack that would have been blamed on his alter ego.

At the same time investigators picked up Franco A., they raided the apartment of his friend, a 24-year-old industrial engineering student called Mathias F. The two former rowing buddies had been exchanging texts about targeting asylum seekers and Muslims. In Mathias’ apartment, officers found hand grenades and dynamite.

The case has been a sensation in Germany, not only because of the twists and turns revealed so far about the alleged conspiracy, but because of the questions it raises about how deep and how extensive right-wing extremism runs in the modern German military.

Franco A. had managed to cultivate a reputation as an über-punctual military officer throughout the past year, during which he was stationed in France. Yet he found time to drive back to Bavaria regularly in order to pick up refugee benefit payments (400 euros per month) and attend the various bureaucratic appointments required of “David Benjamin,” he also managed to spend enough time at an asylum home in the southern state to earn the fake refugee a reputation with authorities for being “inconspicuous” and “available.”

In December 2015, Franco A. had convinced the overworked employees at an initial registration facility for refugees in his home state Hesse that he was a 27-year-old Catholic fruit dealer whose father had been murdered by the so-called Islamic State. This was at a time when German Chancellor Angela Merkel’s open door policy saw as many as 10,000 people a day coming into the country, and the usual strict procedures were simply overwhelmed.

Bavaria’s interior minister Joachim Herrmann wasted no time slamming the Franco A. case as “macabre evidence” that “since 2015/16, at times, asylum seekers were recognized without serious examination of their identity.”

In fact, Franco A. didn’t just succeed in registering as an asylum seeker—his application was actually successful. “David Benjamin” explained his lack of Arabic language skills by claiming he’d grown up in a French-speaking colony in Damascus. And when the Federal office for Migration and Refugees (BAMF) interviewed him in November 2016, it seems they bought the entire story, which was told through a French interpreter.

And French isn’t even Franco’s native language (his mother is German and father Italian). Apparently, it was one of his best subjects in school, though. The mother of an old school friend told Der Spiegel that he had been an “eager student,” who had dreams of becoming a journalist.

Franco A.’s double identity was not exposed by the bureaucracy, in the end, but by another very strange twist in his case.

Three months before his arrest on the obstacle course, the lieutenant had gone to Vienna to attend a gala “officers’ ball” in the former imperial palace. At some point, according to Die Welt, he decided to hide a loaded pistol in a bathroom at Vienna International Airport. The cleaning crew discovered it, and when Franco A. returned for it, the police picked him up. He claimed he had just found it.

He was released, but the Austrian police had run his fingerprints, discovered they matched those of “David Benjamin,” and notified their German counterparts, who began to trail him.

While the case of a right-wing extremist army officer posing as a Syrian refugee, possibly in order to carry out a terror attack, certainly would be unprecedented, the presence of such an extremist in the Bundeswehr is not.

“Any military is interesting to extremists with a right-wing mentality,” says historian Michael Wolfssohn, a longtime professor at the Bundeswehr University in Munich. And extremists of every stripe consider a stint with the military useful for weapons training and the potential to steal armaments as well.

In one recent case, a soldier who was tasked with setting up an asylum home in the state of Mecklenburg-Vorpommern was caught sending WhatsApp texts to his colleagues, asking rhetorically, “Do you have anything against refugees?” and then replying to himself: “Yes. Pistols, machine guns and hand grenades.”

That particular soldier is one of the few people who have been fired from the army for right-wing extremist activity, but the army’s secret service is reported to be investigating 280 cases, 97 of which are from this year.

According to Der Spiegel, Franco A. had not exactly been discreet about his far-right inclinations. In 2014, his master’s thesis at the French military university Saint-Cyr shocked his professors with its anti-democratic themes. But there was no formal investigation. Franco got a second chance to do the essay and earned his degree.

This summer, the German government is introducing a new law that allows the Bundeswehr to conduct an extremist background check on applicants before taking them into the service. But Wolfssohn is pessimistic about the kind of impact that will have: “People are already being checked now before being allowed into the military, but sometimes not so thoroughly—the military has difficulties recruiting people so they can’t afford to be too picky.”

Perhaps, but the Franco A. case shows just how careful Germany, and the rest of Europe, needs to be, whether recruiting soldiers or screening refugees.