A 19-year-old man armed with an assault-type rifle opened fire inside a Southern California synagogue on Saturday as worshipers prepared to celebrate the last day of Passover, killing a woman and injuring three others, authorities said.

An unidentified off-duty border patrol agent who was inside Chabad of Poway synagogue fired at the shooter – identified later as John Earnest – missing him, but striking his getaway vehicle, authorities said.

While in the vehicle, Earnest called 911 to report the shooting, San Diego Police Chief David Nisleit said. When an officer reached the man on a roadway, “the suspect pulled over, jumped out of his car with his hands up and was immediately taken into custody,” he added.

POLITICIANS REACT TO CALIFORNIA SYNAGOGUE SHOOTING: 'NO ONE SHOULD EVER FEAR GOING TO THEIR PLACE OF WORSHIP'

A girl and two men - including the rabbi - were wounded and transported to the hospital. They were said to be in stable condition.

At a news conference later Saturday, San Diego County Sheriff Bill Gore said FBI and homicide agents have interviewed Earnest and they are looking into his social media accounts.

He said they are investigating reports that the 19-year-old, who had no prior contact with law enforcement before Saturday, had written an anti-Jewish screed online.

Gore said they are trying to determine the validity of the manifesto. He said Earnest is also being investigated for a possible connection to arson that caused property damage at Dar-ul-Arqam mosque in Escondido last month. No injuries were reported in that fire.

In a later statement, the sheriff's department said they believe Earnest acted alone.

"The Sheriff's Department would like to assure our communities that there are no known threats to religious gatherings. We encourage our communities to continue with scheduled events and other activities as normal," the statement said.

President Trump and other elected officials decried what they called an anti-Semitic attack exactly six months since 11 people were killed at a Pittsburgh synagogue in the deadliest assault on Jews in U.S. history.

Trump offered his sympathies Saturday, saying the shooting “looked like a hate crime,” and called it “hard to believe.”

“Thoughts and prayers to all of those affected by the shooting at the Synagogue in Poway, California. God bless you all,” Trump also tweeted. “Suspect apprehended. Law enforcement did outstanding job. Thank you!”

He then praised the off-duty patrol agent who shot at Earnest inside the synagogue.

“Sincerest THANK YOU to our great Border Patrol Agent who stopped the shooter at the Synagogue in Poway, California,” Trump wrote. “He may have been off duty but his talents for Law Enforcement weren’t!”

Sources told Fox News that the border patrol agent was a member of Chabad of Poway.

Minoo Anvari, a member of the synagogue, told media outlets that her husband was inside during the shooting. She said he called to tell her the shooter was shouting and cursing.

She called the shooting "unbelievable" in a peaceful and tight-knit community.

"We are strong; you can't break us," Anvari said.

California Gov. Gavin Newsom also weighed in on the shooting, tweeting his support for the city of Poway, which is about 20 miles north of San Diego.

“No one should ever fear going to their place of worship,” he said. “Hate continues to fuel horrific and cowardly acts of violence across our state, country, and world. It must be called out. CA stands with Poway.”

CLICK HERE TO GET THE FOX NEWS APP

Likewise, Poway Mayor Steve Vaus at the news conference said this act of violence does not adequately portray the city.

"We always walk with our arms around each other and we will walk through this tragedy with our arms around each other," Vaus said. "Poway will stay strong and we will always be a community that cares for one another."

Fox News' Lucia Suarez Sang and the Associated Press contributed to this report.