Armed with a semiautomatic rifle, a gunman on Saturday entered a suburban San Diego County synagogue while congregants were celebrating Passover and opened fire — killing one person and injuring three, including a rabbi, in what authorities believe was a hate-motivated crime.

Authorities later arrested a 19-year-old connected with the shooting.

The gunman entered Chabad of Poway, California, on Chabad Way at about 11:20 a.m. on Saturday morning and began firing.

An unidentified off-duty border patrol agent who was inside Chabad of Poway synagogue at the time of the incident fired back at the shooter — but missed him, Fox News reported. But the patrol agent did strike the man’s getaway vehicle, authorities said.

On Twitter, President Donald Trump mentioned the incident and also praised the off-duty agent for the heroic actions he took during the violent scene:

Who do you think would win the Presidency?

By completing the poll, you agree to receive emails from LifeZette, occasional offers from our partners and that you've read and agree to our privacy policy and legal statement.

The gunman responsible for the rampage was identified as John T. Earnest. He is said to be a resident of Rancho Penasquitos.

Homicide detectives have been questioning him, according to The Los Angeles Times. It appears the individual “wrote a letter posted on the internet filled with anti-Semitic screeds,” the LA Times also noted.

“In the letter, he also talked about planning the attack” some four weeks earlier.

Related: ‘Hatred Will Not Have a Place Anywhere’; Pittsburgh Officials Reveal Massacre Details

Steve Vaus, the mayor of Poway, said the shooting was a  “hate crime” based on statements the shooter was heard making as he entered the synagogue.

Some 100 people were in the synagogue at the time.

“As you can imagine, it was an extremely chaotic scene with people running everywhere when we got here,” said the mayor, the LA Times also reported.

Poway, north of San Diego, is a city of approximately 50,000 residents.