Federal and local law enforcement officials said Wednesday that they had blocked a terrorist conspiracy with roots in the state prison system that had allegedly plotted to attack military facilities, synagogues and the Israeli consulate, among other Southern California targets.

A federal grand jury here indicted the head of a radical Islamic prison gang and three other men on charges of conspiracy to wage war against the U.S. government, conspiracy to kill service members and foreign officials, and other related crimes.

The conspiracy unraveled, officials said, after two of the men were arrested in early July in connection with a string of gas station robberies. A search of one suspect's home turned up jihadist literature, bulletproof vests and lists of potential targets.

"We dodged a bullet here, perhaps many bullets," said Police Chief William J. Bratton. "These individuals had devised a plan, selected targets, obtained the weapons, picked the dates," including Jewish holy days in October.

The indictments highlighted a growing area of concern -- the potential for radical movements to be nurtured within U.S. prisons, where religion is often a solace for an alienated population.

"We have a tendency to think of terrorism as something that is foreign," said U.S. Attorney Debra W. Yang, who added that there is no evidence the prison group was tied to al Qaeda or other overseas organizations. "This is a stark reminder that it can be homegrown."

Officials allege the conspiracy began with Kevin James, 29, a longtime inmate at California State Prison-Sacramento who is serving time for attempted robbery and possession of a weapon in prison. In 1997, James founded a group called Jamiyyat Ul-Islam Is-Saheeh.

According to charging documents, James tried to recruit his fellow inmates into the group, which preached a radical version of Islam that called for members to attack any perceived enemies of the faith. Last fall, one of his alleged recruits, Levar Haney Washington, 25, was paroled from the prison and returned to Los Angeles with orders from James to recruit more followers with clean records, then acquire firearms and explosives.

In late May, Washington began the robberies along with Gregory Vernon Patterson, 21, and Pakistani immigrant Hammad Riaz Samana, 21, both former college students who attended the same suburban mosque as Washington. Yang said the robberies were "designed to finance the operations of the terrorist conspiracy."

Washington remained in contact with James, according to the indictment, updating him on Patterson's and Samana's involvement. The charging documents also allege that Patterson had used the Internet to research the offices of the Israeli airline El Al at Los Angeles International Airport and the Yom Kippur events in the city this fall, while Samana had researched information about the Israeli consulate and military recruiting offices.

If convicted, all four men could face life in prison without parole, officials said.