Los Angels: A gunman opened fire at a synagogue in California, killing one person and injuring three others including the rabbi as worshippers marked the final day of Passover, officials said Saturday.

The shooting in the town of Poway came exactly six months after a white supremacist shot dead 11 people at Pittsburgh’s Tree of Life synagogue — the deadliest attack on the Jewish community in the history of the United States.

“During the shooting, four individuals were wounded and transported to Palimar hospital. One succumbed to their wounds. The other three are in stable condition,” San Diego County Sheriff Bill Gore told a press conference.

He added the injured were a female juvenile and two adult men, while an older woman died from her injuries.

Gore told reporters a 19-year-old man from the city of San Diego had been detained over the shooting, and added investigators were reviewing his social media activity and establishing the legitimacy of an open letter published online.

He said police were called shortly before 11:30 am after the man entered the synagogue and opened fire with an “AR-15 type” weapon.

AR-15 assault rifles have been used in many mass shootings in the United States.

“We have copies of his social media posts and his open letter and we’ll be reviewing those to determine legitimacy of it and how it plays in to the investigation,” he added.

An off-duty border patrol officer who was at the scene fired at the suspect as he fled and struck his car, Gore said.

The man was eventually apprehended by a K-9 officer who had been monitoring dispatch radio and raced to the scene, added San Diego chief of police David Nisleit.

“He clearly saw the suspect’s vehicle, the suspect jumped out with his hands up and was immediately taken into custody by the San Diego police department.

“As the officer was placing this 19-year-old male into custody, he clearly saw a rifle on the front passenger seat of the suspect vehicle. The suspect was taken into custody without further incident.”

Mayor Steve Vaus had earlier told MSNBC the rabbi at the Chabad of Poway synagogue, located in the town of 50,000 around 25 miles (40 kilometers) north of San Diego, was shot in the hand.

“For this to happen only a week later at the end of the Passover, only a week after Easter is horrific,” he told the network.

“We are grateful to those in the congregation there that engaged the shooter and prevented this from being a much more horrific incident.

At the White House, US President Donald Trump offered his “deepest sympathies.”

“At this moment it looks like a hate crime, but my deepest sympathies to all those affected and we’ll get to the bottom of it,” he said.

Minoo Anvari told the local CNN affiliate that her husband was inside the synagogue during the shooting.

“Just one message from all of us from our congregation that we are standing together,” she said.

“We are strong. You can’t break us. We are all together.”

On Twitter, Democratic Congresswoman Alexandria Ocasio-Cortez said she was “heartbroken” by news of the shooting.

“We have a responsibility to love + protect our neighbours,” she said.”

“The hatred and violence has got to stop,” added California representative Mike Levin.