The friend who bought the assault rifles used in the San Bernardino attack faces arraignment on gun, immigration and terrorism-related charges.

Enrique Marquez Jr. is due in a Riverside courthouse Wednesday to answer to five counts that could keep him behind bars for up to 50 years if he's convicted.

Prosecutors say Marquez bought the guns that Syed Rizwan Farook and his wife, Tashfeen Malik, used in the Dec. 2 massacre that killed 14 people and injured 22 others at a building where Farook's colleagues from the San Bernardino county health department were meeting.

Farook and Malik were killed later in a shootout with police.

Prosecutors say Marquez bought the guns in 2011 and 2012 when he and Farook planned an attack they never carried out.