(CNN) A 19-year-old man was in custody after a shooting at a California synagogue on the last day of Passover left at least one person dead and several others wounded, the city's mayor said Saturday.

The shooting occurred at Congregation Chabad in Poway, north of San Diego, Poway Mayor Steve Vaus said. He described it as a possible hate crime.

President Donald Trump, speaking outside the White House Saturday, told reporters, "At this moment it looks like a hate crime, but my deepest sympathies to all of those affected and we'll get to the bottom of it."

The Palomar Medical Center Poway received four patients from the shooting, according to a trauma surgeon.

One patient, a 60-year-old woman, died at the hospital, Dr. Michael Katz said. An employee of the synagogue identified the dead woman as Lori Kaye.

"The other three victims are doing well with their injuries," he told reporters.

A 57-year-old rabbi who was shot suffered what looked like defensive wounds to both of his index fingers. He will likely lose his right index finger, the doctor said.

A 34-year-old man and a girl had shrapnel injuries. The girl, whose age was not given, was wounded in one leg and in the face. She was transferred to a children's hospital and will be monitored overnight.

Vaus said he considered it a hate crime "because of statements that were made when the shooter entered."

San Diego County Sheriff Bill Gore later identified the suspect as John Earnest, of San Diego. Authorities are investigating to see whether Earnest is connected to arson at a mosque in nearby Escondido from last month, he said.

The mayor said the congregation was targeted by "someone with hate in their heart ... towards our Jewish community and that just will not stand." The congregation "took security very seriously," he said.

Gore told reporters that the gunman was armed with an "AR-type assault weapon."

Authorities said an off-duty Border Patrol agent fired at the shooter as he was fleeing the scene, but didn't hit the suspect. Gore said it appears the agent, who the sheriff thinks is a security guard, hit the suspect's car. It is unclear why the suspect fled but it is possible his gun might have malfunctioned, the sheriff added.

The suspect fled the scene and called 911 to say he was involved and give his location, San Diego Police Chief David Nisleit said. A San Diego K-9 officer arrived and the shooter surrendered without incident, he said.

Gore said the suspect was being interviewed by detectives and the FBI.

The sheriff refused comment on a motive.

"I want you to know this is not Poway," Vaus told reporters.

The sheriff's department announced later that authorities believe the shooter acted alone.

Rabbi, while wounded, calls for unity

Congregation member Minoo Anvari, who said her husband witnessed the shooting, said the rabbi called for unity and prayed for peace even after getting shot.

"Rabbi said, 'We are united,'" said Anvari, a refugee from Iran.

"This is something bad (that) is happening all over. And we have to believe that this bad thing is real and we don't have to ignore it. We have to open our eyes. He prayed for peace. I respect him -- even in spite of being injured he refused to go to hospital and he spoke. And he finished his speech and he then left the synagogue."

Anvari said her husband told her the shooter was cursing when he opened fire.

A witness told CNN affiliate KGTV there were six or seven shots followed by screams and then another volley of shots. The witness said the wounded rabbi tried to calm the gunman and members of the congregation.

Congregation Chabad is in Poway, north of San Diego.

The San Diego Police Department is assisting sheriff's deputies with the incident, according to a tweet from Nisleit.

"No known threats however in an abundance of caution, we will be providing extra patrol at places of worship," Nisleit said.

The sheriff said the shooting happened at 11:23 a.m. (2:23 p.m. ET). The synagogue's Facebook page said a Passover celebration was scheduled for 11 a.m.

Did the gunman preface the shooting online?

Authorities are aware of an open letter posted online purportedly by Earnest, Gore said in a news conference. Detectives are "collecting digital evidence" and are in the process of reviewing the online content "to determine its validity and authenticity," the sheriff said.

CNN has read through an open letter posted to the anonymous message board 8chan before the shooting.

In the posting, someone identifying as Earnest references killing Jewish people without making actual reference to Poway, San Diego or the synagogue involved in the shooting. The letter writer talks about planning the attack and references other attacks on houses of worship, including the attack on the Tree of Life Synagogue in Pittsburgh and the Christchurch mosque shootings in New Zealand. The writer also talks about his disdain for Jews and claims responsibility for a mosque fire in Escondido a week and a half after the attacks in Christchurch.

The open letter is structured in a similar fashion to the manifesto linked to Christchurch attack suspect Brenton Tarrant, replete with a question-and-answer section in which the writer refers to questions he comes up with about his character, political affiliation, and motivation for carrying out the alleged shooting.

Passover ending

Passover, one of the holiest Jewish celebrations of the year, ends Saturday.

The incident comes months six months to the day after the shooting at the Tree of Life synagogue in Pittsburgh.

On October 27, Robert Bowers stormed the synagogue, killing 11 people in what the Anti-Defamation League said was the deadliest anti-Semitic attack in US history. A federal law enforcement official said at the time that Bowers made anti-Semitic statements during the shooting and targeted Jews on social media.

The Chabad of Poway website said the congregation is a center for Jewish people of all backgrounds. It was established in 1986.

Poway, about 20 miles north of San Diego, has about 48,000 residents. It is an upper-middle-class community that calls itself "The City in the Country." The city website said it has one of the lowest crime rates in the state.