RIVERSIDE (AP)  — A man who prosecutors say purchased the guns used by the San Bernardino attackers has agreed to plead guilty to conspiring to provide material support to terrorists and lying when he bought the weapons used in the deadly attack, according to court documents released Tuesday.

Enrique Marquez Jr., 25, of Riverside, admitted in a plea agreement that he bought the assault rifles used by Syed Rizwan Farook and his wife, Tashfeen Malik, in the Dec. 2, 2015, attack at a public health agency gathering that left 14 people dead and injured nearly two dozen others. Farook and Malik were later killed in a gunfight with authorities.

READ MORE: Man, 30, Fatally Shot In Long Beach; Motive Unknown

Marquez also agreed to plead guilty to making false statements when he purchased the firearms used in the attack.

FULL COVERAGE: San Bernardino Attack

Prosecutors said Marquez acknowledged being a “straw buyer” when he purchased two assault rifles from a sporting goods store that were used in the attack at the Inland Regional Center in San Bernardino. Prosecutors have said Marquez agreed to buy the weapons because the attackers feared Farook’s Middle Eastern appearance might arouse suspicion.

Marquez also admitted to plotting with Farook in 2011 and 2012 to massacre college students and gun down motorists on a gridlocked California freeway, though those attacks never occurred.

READ MORE: Need A Holiday Package Delivered By Christmas? Here Are Shipping Deadlines

Federal officials said the duo had envisioned halting traffic on the 91 Freeway with explosives and then firing at trapped motorists, or tossing pipe bombs into a crowded cafeteria at Riverside City College.

Marquez said he backed out of the plot after four men in the area about 60 miles inland from Los Angeles were arrested on terrorism charges in late 2012, the FBI has said in court documents.

“While his earlier plans to attack a school and a freeway were not executed, the planning clearly laid the foundation for the 2015 attack on the Inland Regional Center,” U.S. Attorney Eileen M. Decker said Tuesday.

Marquez is scheduled to appear before a federal judge on Thursday. His attorney didn’t immediately respond to messages seeking comment.

MORE NEWS: 18-Month-Old Baby In Grave Condition After North Hills Hit-And-Run

(© Copyright 2017 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)