Rayyan, who had previously been arrested for having marijuana, is now charged with unlawful possession of a firearm and making a false statement to acquire a firearm.

Jannah Bride, not a real name, was in fact an FBI informant hired to communicate with Rayyan, who first came to the FBI’s attention when he retweeted a video from the Islamic State of people being thrown from buildings. He wrote later on Twitter: “Thanks, brother, that made my day.”

Documents released Tuesday show, however, that Rayyan was motivated not by religious radicalism but by the desire to impress Bride, who said she wanted to be a martyr.

Now, Rayyan, a 21-year-old Michigan man, is accused by federal prosecutors of supporting the Islamic State.

KHALIL ABU RAYYAN was a lonely young man in Detroit, eager to find a wife. Jannah Bride claimed she was a 19-year-old Sunni Muslim whose husband was killed in an airstrike in Syria. The two struck up a romantic connection through online communications.

Although Rayyan is not charged with terrorism, the FBI and federal prosecutors have treated his case as a national security concern, making numerous references in court filings and at a detention hearing to statements Rayyan made about the Islamic State and his supposed aspirations for violence.

Rayyan has pleaded not guilty to the federal gun charges, and his lawyers have asked the court to force the government to turn over all remaining communications between Rayyan and the FBI informant.

According to transcripts of conversations between Rayyan and the informant — which were made public for the first time this week — Rayyan had fallen in love with Bride and had even proposed marriage.

The transcripts show that the FBI informant initiated conversations about violence on several occasions, and when she did, Rayyan would tell her that he didn’t want to hurt anyone. In an online conversation on December 26, 2015, the informant asked Rayyan, using the Arabic word meaning this earthly life, “What do you want from this Dunya?”

“Honestly to get married,” he responded. “I think if I get married I will be happy. I’m just lonely sometimes. I want to start a family.”

In a conversation a month later, the informant told Rayyan that if the Islamic State “asks for my life I would give it up in a heartbeat.”

Rayyan replied, “Your [sic] young and confused,” adding, “I don’t think you know what you want.”

In another exchange, Rayyan told the informant, “I want us to be together.”

“I have other plans,” she replied.

He cautioned, “Don’t do anything that will hurt you, yourself or other people.”

Eventually, Rayyan found a way to capture the woman’s interest, describing his plans for an attack:

I tried to shoot up a church one day. I don’t know the name of it, but it’s close to my job. It’s one of the biggest ones in Detroit. Ya, I had it planned out. I bought a bunch of bullets. I practiced a lot with it. I practiced reloading and unloading. But my dad searched my car one day and he found everything. He found the gun and the bullets and a mask I was going to wear.

The story appears to be fantasy, however.

After his arrest, FBI agents searched his home and car and did not find an AK-47 or bullets. The only weapon he had was a six-shot .22 caliber handgun, which he had acquired for self-defense while delivering pizzas in Detroit, according to his lawyer. The only mask found was one Rayyan’s father kept at his pizza shop for years to entertain kids on Halloween.

“Maybe there was no AK-47, but there was an expression of an intent,” Assistant U.S. Attorney Ronald Waterstreet said in a February 16 detention hearing.

A psychologist hired by the defense, Lyle D. Danuloff, assessed Rayyan’s level of dangerousness as “very low,” according to a report filed Tuesday.

“Behavior with FBI undercover agent the result of deep longings for female attention in a very shy and awkward young man,” Danuloff wrote in a report for the court. “His verbalization was the result of an effort to keep the attention with hopes of a future. They were not the result of radicalization or representative of terrorist intentions.”

The FBI uses more than 15,000 informants widely in counterterrorism investigations. Recent FBI investigations have focused on alleged Islamic State sympathizers, many with highly questionable outcomes.

On December 31, 2015, with the help of an undercover informant, the FBI arrested a mentally ill homeless man and charged him with plotting to attack a New Year Eve’s celebration in upstate New York. His only weapons were knives and a machete, which he bought at Wal-Mart for $40 using money provided by the FBI through an informant.

Female informants in national security investigations are rare. But this isn’t the first time the FBI has been accused of creating a honeypot under the guise of national security.

In California, alleged eco-terrorist Eric McDavid was released last year after his lawyers discovered the government withheld documents, including love letters, which showed the FBI had manipulated him through an informant known as “Anna.”