LOS ANGELES (AP) — The only man to be criminally charged in the San Bernardino terror attack has agreed to plead guilty to providing the high-powered rifles used to kill 14 people and injure nearly two dozen others and to plotting a mass killing with the gunman that they never carried out, court records say.

Enrique Marquez Jr., 25, of Riverside, admitted in a plea agreement released Tuesday 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. Farook and Malik were later killed in a gunfight with authorities.

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

Prosecutors said Marquez acknowledged being a "straw buyer" when he purchased two AR-15 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. Prosecutors said there is no evidence Marquez participated in the San Bernardino massacre or had advance knowledge of it.

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.

Federal officials said the duo had envisioned halting traffic on state Route 91 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, who could face up to 25 years in prison, is scheduled to appear before a federal judge on Thursday. His attorney didn't immediately respond to messages seeking comment.

Mandy Pifer, whose boyfriend Shannon Johnson was killed in the terror attack, said the plea agreement brought mixed emotions.

"It's a hell of a day to come out, Valentine's Day," the 42-year-old Los Angeles resident said. "I'm relieved that it won't be a long trial. If it'll be finished sooner, I'm all for it."

She said she planned to speak at Marquez's sentencing about the impact her boyfriend's killing has had on her. In his last moments, Johnson huddled with a colleague under a table, shielding her from the bullets.

"It is what it is," she said. "Nothing's going to bring him back."

Marquez and Farook first met in 2005 after Marquez moved next door to Farook's family in Riverside, about 55 miles east of downtown Los Angeles, officials said. The then-teens would meet in Farook's garage and Farook, a Muslim, began educating his new friend about his religion. Marquez converted and became a Muslim in 2007.

The FBI said the two began discussing extremist views shortly after Marquez converted. By late 2011, Marquez spent most of his time at Farook's home, where he read Inspire magazine, an official publication of al-Qaida in the Arabian Peninsula; watched videos produced by al-Qaida's affiliate in Somalia; and studied radical material online, federal officials said.

__

Associated Press writer Amanda Lee Myers contributed to this report.

__

Follow Michael Balsamo on Twitter at http://twitter.com/MikeBalsamo1.