BERLIN—Two years before 52-year-old Roque M started a new job in the German domestic intelligence service (the BfV, known in English as the Federal Office for the Protection of the Constitution), he converted to Islam during a single telephone call with an Austrian man, and also started getting heavily into tattoos.

So began, it seems, one of the strangest tales of espionage, or counter-espionage, or maybe it was fantasy espionage, in the recent annals of Western intelligence. Was it inspired by the so-called Islamic State, by a commitment to jihad, or was it, perhaps, attributable to pure boredom?

First, as documented by the selfies he uploaded on Facebook, M (as he is known in the German press because of privacy laws) got the promise “ Ein Mann, Ein Wort ” (A man of his word) etched across his chest in standard black letter font. Then an esoteric zigzag on his hip and a soldier on his left bicep, which he didn’t bother to have completed. And finally, right before he was arrested last November on suspicion of plotting terror attacks against “unbelievers”—Che Guevara’s beret-portrait slapped right next to his heart.

“Nobody knows who he is,” the investigative journalist Hans Leyendecker told me about M in November. Not his colleague, who caught him advertising himself as an undercover jihadist in a chatroom popular among Islamic militants. Nor his respectable wife, a teacher.

After the police uncovered additional evidence that M starred in gay porn films, and that he daydreamed about running away and becoming a monk, his wife is now filing for a divorce. “He himself doesn’t seem to know who he is,” Leyendecker added.

Back then, the BfV boss Hans-Georg Maaßen insisted that the “very, very high” security precautions in M’s application process to become an “observer” of Germany’s Islamist scene had been met. But the agency still decided to run another background check on new hires.

Being a spy in Germany is not considered exciting (or honorable). The BfV had been pretty desperate to fill jobs, especially now that it is expanding its operations to try to meet new terror threats.

Why did M want to join? He told the court that his many conflicting secret identities were “just a game” that he played from his sofa on weekends when he had a lot of time on his hands.

During M’s initial interrogation, he warned police officers that he had plans to travel to Syria to fight alongside the so-called Islamic State. But the judge, who on Tuesday handed M a one year suspended sentence for offering to spy on the BfV “to help his brothers” in ISIS, appears to have been annoyed mainly by the accused’s inclination for “drama“ and “pomposity” rather than the potential threat he posed.

In court, M, whom friends describe as temperamental, kept his face covered with a binder. His appearance had changed dramatically over the past few years, and not just because he got inked. “What happened to you?” friends on Facebook commented on a picture that showed him posing for the camera, with his newly greying hair styled into a megalomaniac Mohawk and a big mustache. “It’s a disguise,” he replied.

It’s also a far cry from an article that appeared in a German tabloid Bild years ago, which showed a picture of M with his family. His dark hair is neatly trimmed, and he is smiling gawkily to reveal a set of crooked teeth. The article was about M’s third child, a boy, who was premature. In the prenatal ward, he was infected by a rotavirus that caused severe brain damage.

M’s wife told the tabloid that it was only after this devastating incident that the ward was disinfected for the virus and warning signs were put up. After M’s arrest, journalists from the same tabloid went back to M’s hometown, Tönisvorst, to try to get some gossip.

“I know him as a loving father” who “also took special care of his disabled kid,” one neighbor told the tabloid. M had even started a charity to help families with disabled children pay for dolphin therapy, a controversial treatment based on anecdotal evidence that swimming with dolphins can cure a wide range of disabilities.

On weekends, M stayed home and looked after his son. And this is where he said he struggled: “You sit there with your phone, you can’t do anything, and once again you’re in the internet.”

Online, he took part in a chat about joining the monastery. He set up an online company called German Military Underwear, which sold underwear. He gave the company the slogan: “Strong, manly, sexy, Nordic.” He joined a chat by the right-wing extremist group Nordic Brotherhood. He uploaded songs with sexual lyrics onto various conversation threads and wrote that he’d recorded them himself.

“It was fantasy for me,” he explained.

And then, after his arrest, M told the police officers that he had infiltrated the intelligence service because it was “Allah’s will,” and that even though “you may have me now“ the bigger plan for infiltrating the BfV “will go on.”

These were some jarring confessions—except police did not find any corroborating evidence of M having ties to Islamic groups, or that he was planning an attack.

Tönisvorst is a small town where not much happens. But three days before the cops came to pick up M, a bunch of squad cars drove down the Gelderner Strasse and special officers with explosive-sniffing dogs raced out to arrest Abu Walaa, a preacher about to go on trial for being, among other alleged things, the biggest ISIS recruiter in Germany. He, too, was living in a small house with a garden in Tönisvurst, just like M.

So, after M was picked up, interrogators asked him about Abu Walaa. M said he “knows who that is” but didn’t want to “betray anyone.“

Apparently, some locals were sorry they’d missed the excitement of all these arrests. When a reporter then came to Tönisvorst to ask if they were worried about living in Germany’s new “extremist hotbed,” residents joked about renaming their city to St.TonIS.

A few people simply replied it was logical that terrorists would prefer to hide out in a place as calm and attractive at Tönisvorst, as opposed to, say, Cologne or Berlin.