A gunman fired his semi-automatic rifle at Jewish worshippers after walking through a Southern California synagogue's open front door, a spot that synagogue leaders determined last year needed improved security.

The Chabad of Poway synagogue applied for a federal grant to install gates and more secure doors to better protect that area. The $150,000 was approved in September but only got awarded in late March.

"Obviously we did not have a chance to start using the funds yet," Rabbi Simcha Backman told The Associated Press.

Backman, who oversees security grants for the 207 Chabad institutions across California, declined to provide details on the planned security enhancements or to speculate whether they might have changed the outcome of Saturday's attack.

The shooter killed a woman and wounded an 8-year-old girl, her uncle and Rabbi Yisroel Goldstein, who was leading the service on the last day of Passover, a major Jewish holiday.

Backman said the synagogue north of San Diego is considering asking authorities to allow some of the money be used to hire security guards.

The synagogue doesn't have guards now. But after a gunman massacred 11 people at the Tree of Life synagogue in Pittsburgh last October, rabbis of California's Chabad organization, including at the Poway synagogue, began asking members who were trained law enforcement professionals to carry their weapons at services, Backman said.

The congregation also received training from the city of Poway on responding to an active shooter, and Goldstein applied for a concealed carry permit.

On Saturday, an off-duty Border Patrol agent who attends the synagogue fired at the gunman as he fled, hitting his vehicle. The 19-year-old suspect, John T. Earnest, has pleaded not guilty to murder and attempted murder charges.

The Poway synagogue was built two decades ago with security features such as video surveillance, but it started to beef up its measures in 2010. The synagogue received and spent money from a $75,000 grant that records show was earmarked for a security assessment, 16 cameras, fencing and lighting.

The synagogue applied for another grant in May 2018 to upgrade those cameras and add other enhancements. It was approved in September, but the funds weren't released until March 22.

Backman said it often takes at least a year to complete the paperwork and necessary approvals.

The security grant program is funded by the Federal Emergency Management Agency and administered in California by the state Office of Emergency Services.

While the synagogue got approval in September, a workshop on the required documents was not held until the end of October and the synagogue submitted its first documents in early February, Office of Emergency Services spokesman Brad Alexander said. The state then requested additional information before awarding the money.

"It seems like a long time from the time they granted to the authorization," said Republican state Sen. Brian Jones, whose district includes the synagogue. "I would like to find out if there's a way we can speed this up, can we remove some bureaucratic steps here to help these organizations get these improvements done quicker?"

New FEMA rules allow the grants to be spent on security guards, and state officials said recipients can seek a modification to existing grants to use the money that way. Backman said the synagogue is considering it and will find the funds to hire guards even if the government does not fund them.

With hate crimes against Jews and other religious and racial minorities growing, Gov. Gavin Newsom is backing legislation that would change a similar state grant program to allow money for guards. He said institutions should decide whether those guards are armed.

Democratic Assemblyman Jesse Gabriel, who is sponsoring the legislation, said Thursday that one goal is "to make sure that vulnerable communities that need additional security are getting this financial help as quickly as possible."

Goldstein, who lost a finger in the shooting and joined President Donald Trump on Thursday for the National Day of Prayer , has talked to Newsom, while the Chabad organization sent rabbis to Sacramento to push for funds to secure places of worship, Backman said.

Backman applauded Newsom's announcement Monday about budgeting $15 million to increase security for religious institutions and other vulnerable nonprofits. Last year, the program got $500,000.

Jewish-affiliated organizations in California received 79% of the 264 nonprofit security grants awarded under the federal and state programs since 2012. The remaining 21% went to institutions serving other faiths, hospitals, Planned Parenthood chapters, domestic violence shelters, museums and a university.

Houses of worship, like all institutions open to the public, face a balancing act in providing security while maintaining a welcoming atmosphere, said Jesus Villahermosa, a former law enforcement officer in Washington state who teaches classes nationwide on deterring and reacting to active shooters.

"All the mechanical security in the world isn't going to change that anyone in America can walk in to any place in America and open fire," he said. "It's difficult because I don't think there is a perfect solution."

Even installing metal detectors merely makes those gathered there the potential initial target, he said.

Villahermosa said synagogue leaders were wise to ask officers to come armed and agreed with them about the danger of untrained people bringing weapons to services for fear they will shoot bystanders.

Layers of security would be best, he said, including professional armed guards at entrances, embedded in the congregation and at the front of the worship area.

Government help for that makes sense because millions of Americans attend places of worship, Backman said.

"I understand the concern for separation of church and state, but this is not about the government supporting one religious institution over another," he said. "It's about the government protecting its citizens."

___

Thompson reported from Sacramento. Associated Press writer Adam Beam in Sacramento contributed to this story.