RIVERSIDE, Calif.

- The man who bought the assault rifles his friend used in the San Bernardino massacre was charged yesterday with a terrorism-related charge alleging he plotted earlier attacks at a college they attended and on a congested freeway.

The duo, who had become adherents to radicalized Islam ideology as neighbors in Riverside, plotted in 2011 and 2012 to maximize carnage by using pipe bombs and guns to kill innocent people at a campus cafeteria and those stuck in rush hour traffic, court documents said. The plots fizzled and they never acted.

Enrique Marquez Jr., 24, was charged with conspiring to provide material support to terrorists for those earlier plots with Syed Rizwan Farook.

Those plans may never have come to light if not for the Dec. 2 terrorist attack where Farook and his wife, Tashfeen Malik, used guns Marquez bought years ago to kill 14 people at a holiday meeting of Farook's health department co-workers.

Marquez was charged with illegally purchasing the rifles that the shooters used again hours later in a gunbattle with police. The couple were killed in the shootout.

In his initial court appearance, Marquez looked disheveled. His hair flopped over his forehead, there was stubble on his face, and the pockets of his black pants were turned out. He appeared calm and showed no emotion as he gave one-word answers to the judge.

No plea was entered and he was ordered held until a bail hearing Monday. His public defender declined comment.

Marquez was working at a Riverside bar at the time of the shooting and is not alleged to have had a role in the attack.

But prosecutors said he was linked to the killings by the guns and explosive materials he bought years earlier. The couple used that material in a remote-controlled pipe bomb that never detonated at the conference room where the shootings occurred.