The friend of the terrorist couple behind the Dec. 2 attack that left 14 dead in San Bernardino was arrested Thursday and charged on multiple counts.

Enrique Marquez, 24, was charged with conspiring to provide material support to terrorists based upon his role in terrorist plotting with Syed Farook in 2011 and 2012, the unlawful purchase of the two assault rifles used in the deadly shooting two weeks ago and defrauding immigration authorities by entering into a sham marriage with a member of Farook’s family. 

The documents describing charges said he admitted plotting the attacks with Farook on Riverside Community College and State Route 91 in or around late 2011. At the college, where both men had previously been students, the men planned to throw pipe bombs into crowds of students at the library or cafeteria.

Investigators say Marquez discussed specific plans to throw the bombs on gathered students at the cafeteria from the upper floors. The documents said the men also identified a long stretch of the 91 freeway with no exits, where Farook would throw pipe bombs that would stop rush-hour traffic, allowing him then to walk along the freeway and gun down motorists in their stranded cars.

Marquez began speaking with federal authorities after they raided his mother's home following the San Bernardino attack. Right after the shootings, Marquez reportedly called his mother to say he was safe, but that he wouldn't be coming home, neighbor Lorena Aguirre told The Associated Press. He later checked into a mental health facility.

Marquez is also related to Farook by marriage, having wed the sister-in-law of the gunman's older brother, state records show. The Associated Press reported that Marquez and and his bride, Mariya Chernykh, listed their address on the marriage license at the same Corona home where Syed Raheel and Tatiana Farook live. Viviana Ramirez, a friend of Marquez, told the Los Angeles Times that Marquez rarely spoke about his family or his marriage.

Marquez is reportedly a recent convert to Islam. He had a security guard license in California for several years, but it expired last year. He had worked at Walmart since May, but has since been fired, spokesman Brian Nick told The Associated Press.

Marquez legally purchased the AR-15 rifles used in the San Bernardino massacre and later cooperated with investigators.

Investigators believe Marquez bought the rifles and gave them or sold them to Farook in preparation for the earlier planned attack.

Farook and Malik stormed into the Inland Regional Center in San Bernardino, where Farook's co-workers at the country health department were holding a holiday party, and opened fire. The pair were killed hours later in a shootout with police.

The FBI has confirmed the attack was terror related, but so far believe the pair was inspired, but not directed, by ISIS.

Farook was a U.S. citizen who was born in Chicago and grew up in Southern California. Malik was a native of Pakistan who came to the U.S. in 2014 on a fiance visa and married Farook. They left behind a six-month-old daughter.  

Fox News Channel's Matthew Dean and Adam Housley and The Associated Press contributed to this report