Enrique Marquez Jr., a friend and former neighbor of San Bernardino, California, gunman Syed Rizwan Farook, was charged Thursday with buying the rifles used in the Dec. 2 assault and plotting other terrorist attacks with Farook in 2011 and 2012.

Investigators said Marquez, 24, bought the .223-caliber DPMS model AR-15 and the Smith & Wesson M&P15 assault-style rifles used in the shootings at the Inland Resource Center, which killed 14 people.

He was charged in U.S. District Court in Riverside, California, with conspiring with Farook to provide material support — including himself, a firearm and explosives — for crimes of terrorism; making a false statement in connection with the acquisition of firearms; and immigration fraud for what authorities said was his sham marriage to a distant relative of Farook's.

If he's convicted, Marquez, who was arrested at 12:45 p.m. (3:45 p.m. ET), could face 15 years in federal prison on the terrorism charge and 10 years each on the two other charges. Bail will be set Monday, and a preliminary hearing was scheduled for Jan. 4.

U.S. Attorney Eileen Decker stressed that there was, as yet, no evidence that Marquez took part in or knew about the resource center attack. But she said his purchase of the firearms and his failure to warn authorities about Farook's intention to carry out some sort of mass casualty attack "had fatal consequences."

Syed Rizwan Farook and Tashfeen Malik. California Department of Motor Vehicles and FBI

Related: Attackers Had Makings for Three More Remote-Control Bombs

Authorities had previously told NBC News that Marquez bought the rifles and gave them to Farook. In an affidavit accompanying the charges, the FBI disclosed that he is also believed to have bought explosive material used to build a pipe bomb found at the scene.

In late 2011, according to the affidavit, Marquez and Farook started planning to carry out terrorist acts designed to maximize casualties — including plans to attack the library or the cafeteria at Riverside Community College, where both men had been students. They planned to throw pipe bombs from the second floor and then shoot people as they fled, the FBI alleged.

Weapons carried by the suspects in the Dec. 2 mass shootings in San Bernardino, California. San Bernardino County, California, Sheriff's Office

According to the affidavit, Marquez and Farook also planned to attack a section of State Route 91 during the afternoon rush hour — because there are no exits, which would trap more potential victims. Farook was then to walk down the roadway shooting into vehicles, the FBI said; Marquez was to be the lookout and shoot any first responders.

In late 2011 and 2012, Marquez bought two firearms for about $750 each for Farook and portrayed himself as the real buyer, the FBI said. According to the affidavit, Marquez told investigators he agreed to the ruse because "his appearance was Caucasian, while Farook looked Middle Eastern."

Related: How the Rampage Unfolded

In the first half of 2012, Marquez and Farook continued plotting terrorist attacks, but later in the year, Marquez backed away for a variety of reasons, including the announcement of arrests in unrelated terrorism cases in November 2012, according to the affidavit.

The third charge — the sham marriage — is related to Marquez's wedding to a member of Farook's extended family so she could obtain legal U.S. status, prosecutors said. In return, she paid Marquez $200 month, according to the charges.

Related: FBI Talking to Enrique Marquez, Who Bought Guns Used in San Bernardino

Marquez moved to Riverside around 2005, becoming next-door neighbors with Farook. Investigators said Farook introduced Marquez to Islam, and Marquez converted in 2007.

Farook later introduced Marquez to radical Islamic ideology, including the extremist views of Anwar al-Awlaki, the U.S.-born al Qaeda recruiter who was killed by a U.S. drone in 2011, according to the affidavit. In August 2011, Farook informed Marquez of his interest in joining the Yemen affiliate of al Qaeda in the Arabian Peninsula, it said.

With the main suspects dead, the indictment represents possibly the only charges to be brought in the terrifying attack. Prosecutors used it to reveal significant new information about Farook and Malik, as well as Marquez:

The FBI was able to retrieve significant information from a thumb drive found in the home of FGarook and Malik. In a folder called "Marriage," Farook maintained a spreadsheet cataloging expenses for purchases of firearms and ammunition, as well as shooting time at a firing range, investigators said.

Marquez admitted his involvement in terrorism in a Facebook post on Nov. 5, almost a full month before the shootings. Explaining why he was feeling depressed, he wrote: "Involved in terrorist plots, drugs, antisocial behavior, marriage, might go to prison for fraud, etc."

While authorities have said Farook and Malik posted no public jihadist messages before Malik entered the country on a fiancée visa, the FBI said Malik may have posted such sentiments only a few minutes before the couple stormed the Inland Resource Center. "We pledge allegiance to Khalifa bu bkr al baghdadi al quraishi," said a post appeared on an account associated with Malik. The FBI said it believed the post referred to Abu Bakr al-Baghdadi — the leader of ISIS.

Related: San Bernardino Shooters Practiced for Attack a Year in Advance

Marquez checked himself into a mental hospital for a few days after the shootings this month. Farook and his wife, Tashfeen Malik, who were killed in a shootout with authorities a few hours after the massacre, were quietly buried Tuesday in Southern California.