A longtime friend of San Bernardino shooter Syed Farook has agreed to plead guilty to providing weapons and other support to terrorists, as well as plotting an additional attack in Riverside that did not occur, officials said.

Enrique Marquez Jr., 25, of Riverside, entered a federal plea agreement in which he pleads guilty to providing material support and resources to terrorists, including weapons, explosives and personnel, according to the U.S. Attorney's Office.

Officials say that Marquez conspired with Farook in 2011 and 2012 to attack Riverside City College as well as commuter traffic on the 91 Freeway. He also has agreed to plead guilty of making false statements in connection with buying two assault rifles that were used in the San Bernardino terror attack on Dec. 2, 2015.

The guilty plea is expected to be entered in federal court Thursday morning.

"This defendant collaborated with and purchased weapons for a man who carried out the devastating December 2, 2015 terrorist attack that took the lives of 14 innocent people, wounded nearly two dozen, and impacted our entire nation," said U.S. Attorney Eileen M. Decker.

"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."

Investigators say Marquez bought two rifles that Farook and his wife, Tashfeen Malik, used in the attack.

Officials say the two also discussed using radio-controlled improvised explosive devices during the planning for the Riverside attacks, and that Marquez purchased ingredients for the device, including Christmas tree lightbulbs and smokeless powder.

Marquez was arrested about two weeks after the terrorist shooting at the Inland Regional Center in San Bernardino in which 14 people were killed and 22 were injured. He has remained in custody since his initial court appearance in December 2015.

After the guilty plea is entered, he faces a statutory maximum sentence of 25 years in federal prison, according to the U.S. Attorney's Office.