Police searched a lake earlier this month as part of the investigation of the San Bernardino shooting.Jonathan Alcorn / Reuters

Updated on December 17 at 6:35 p.m. EST

Federal agents arrested on Thursday a friend of one of the San Bernardino shooters who prosecutors say purchased assault weapons that were used in the deadly attack this month.

The FBI arrested Enrique Marquez, 24, a longtime friend and former neighbor of Syed Rizwan Farook, the man who, along with his wife, Tashfeen Malik, killed 14 people and wounded 21 others in a shooting rampage at his office holiday party in California earlier this month.

The criminal complaint alleges that Marquez, a resident of Riverside, California, provided “material support—including himself, a firearm, and explosives—for crimes of terrorism.” He was also charged with conspiracy for planning terrorist attacks with Farook in 2011 and 2012 that were never carried out; the illegal purchase of two AR-15-style rifles used in the shooting and explosive material that was eventually used to build a pipe bomb found at the center where the shooting occurred; and immigration fraud, for entering a “sham” marriage with a member of Farook’s family, who paid Marquez $200 a month, so that she could remain in the U.S., according to the Department of Justice.

Marquez, who was not directly involved in the San Bernardino shooting, is the first person to be charged in connection with the attack. The Department of Justice said Marquez and Farook met in 2005, and Marquez became radicalized soon after:

After their initial meeting, Farook introduced Marquez to Islam, and, in 2007, Marquez converted to Islam. Farook later introduced Marquez to radical Islamic ideology, which included expressing disdain towards Muslims in the U.S. military who killed other Muslims, as well as discussing the extremist views of the now-deceased imam and Islamic lecturer Anwar al-Aulaqi. Over the next few years, Farook provided Marquez with radical Islamic materials, and by 2011, Marquez spent most of his time at Farook’s residence listening to lectures and watching videos involving radical Islamic content. Those materials included Inspire Magazine, the official publication of Al-Qaeda in the Arabian Peninsula (AQAP), and videos produced by Al-Shabaab.

Like Malik, Marquez went with Farook to target ranges to practice shooting, prosecutors said.

Federal officials determined soon after the attack the shooters were inspired by foreign terrorist organizations. The Islamic State praised the assault, calling Farook and Malik “followers,” but did not claim responsibility for organizing it, as it had done in Paris last month.

The affidavit states that a Facebook account “associated” with Malik searched for information on the Islamic State on the morning of the shooting. Shortly after the attack, a post on a Facebook page “associated” with the woman pledged allegience to the leader of the Islamist militant group, investigators found.

In the days after the shooting, one question emerged: Did U.S. intelligence miss warning signs about Farook and Malik. Farook was born in Illinois and had worked for the San Bernardino County’s public health department as an inspector for five years. Malik was born in Pakistan and arrived in the U.S. last year on a fiancee visa to marry Farook, whom she’d met on a dating website for Muslims. The couple had a six-month-old child, and lived in a quiet neighborhood not far from where the shooting occurred.

But while Farook and Malik had spoken of jihad online several years ago, even before they began dating, “those communications are private direct messages,” said the FBI’s director, James Comey, on Wednesday. The messages were also general in nature, and not about specific plots. As my colleague David Graham wrote Thursday, “the fact that the messages in question were private, beyond the reasonable ken of law enforcement and well past constitutional limitations, is yet another indication of the steep challenge American officials face in trying to stop homegrown attackers who are inspired by ISIS or other terrorist groups but appear to be acting largely autonomously, without instruction from known terrorist leaders.”

President Obama recently pointed to the difficulty of uncovering and preventing homegrown jihadist terrorist plots. “As groups like ISIL grew stronger amidst the chaos of war in Iraq and then Syria, and as the Internet erases the distance between countries, we see growing efforts by terrorists to poison the minds of people like the Boston Marathon bombers and the San Bernardino killers,” he said in a televised address.

Funerals for the shooting victims were held this week. Obama will travel to San Bernardino on Friday to meet privately with the families of the victims.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.