Four Southern California men have been charged with plotting to kill Americans in the US and overseas by joining al-Qaida and the Taliban in Afghanistan, federal officials said.

The defendants were arrested for plotting to bomb government facilities and public places after federal authorities uncovered their plans to engage in "violent jihad", the FBI spokeswoman Laura Eimiller said.

According to a federal complaint unsealed on Monday during their initial appearances, Sohiel Omar Kabir, 34, introduced two other California men to the radical Islamist doctrine of Anwar al-Awlaki, a deceased al-Qaida leader.

The two, Ralph Deleon, 23, and Miguel Alejandro Santana Vidriales, 21, converted to Islam in 2010 and began engaging with Kabir and others online in discussions about jihad, including posting radical content on Facebook and expressing extremist views in comments.

In one online conversation, Santana told an FBI undercover agent he wanted to commit jihad and expressed interest in a jihadist training camp in Jalalabad, Afghanistan.

The complaint alleged the men went to a shooting range several times, including a trip on 10 September 2012 when Deleon told a confidential FBI source he wanted to be on the frontlines overseas and use the explosive C-4 in an attack. Santana agreed.

"I wanna do C-4s if I could put one of these trucks right here with my, with that. Just drive into, like, the baddest military base," Santana said, according to the complaint, adding that he wanted to use a large quantity of the explosive.

"If I'm gonna do that, I'm gonna take out a whole base. Might as well make it, like, big, ya know," Santana said.

At the shooting range that day, both Santana and Deleon said they were excited about the rewards from becoming a shaheed – Arabic for martyr – according to the complaint.

Authorities allege Kabir travelled to Afghanistan and communicated with Santana and Deleon so he could arrange for their travel to join him and meet with his contacts in terrorism organisations. They later recruited 21-year-old Arifeen David Gojali.

If convicted, the defendants each face a maximum penalty of 15 years in federal prison.