Open this photo in gallery Police officers are seen at a crime scene in Halle, Germany, on Oct. 9, 2019. Sebastian Willnow/The Associated Press

A heavily armed assailant ranting about Jews tried to force his way into a synagogue in Germany on Yom Kippur, Judaism’s holiest day, then shot two people to death nearby in an attack Wednesday that was livestreamed on a popular gaming site.

The attacker shot at the door of the synagogue in the eastern city of Halle but did not get in as 70 to 80 people inside were observing the holy day.

The gunman shouted that Jews were “the root” of “problems” such as feminism and “mass immigration,” according to a group that tracks online extremism. It said a roughly 36-minute video posted online featured the assailant, who spoke a combination of English and German, denying the Holocaust before he shot a woman in the street after failing to enter the synagogue. He then entered a nearby kebab shop and killed another person before fleeing.

Germany’s top security official, Interior Minister Horst Seehofer, said authorities must assume that it was an anti-Semitic attack, and said prosecutors believe there may be a right-wing extremist motive. He said several people were hurt.

The attack “strikes the Jewish community, Jewish people not just in Germany but particularly in Germany, to the core,” said the country’s main Jewish leader, Josef Schuster. “It was, I think, only lucky circumstances that prevented a bigger massacre.”

The filming of Wednesday’s attack echoed another horrific shooting halfway around the world when a far-right white supremacist in March killed 51 people at two mosques in Christchurch, New Zealand and livestreamed much of the attack on Facebook. That massacre drew strong criticism of social media giants for not immediately finding and blocking such a violent video.

Wednesday’s assault followed attacks in the United States over the past year on synagogues in Pittsburgh and Poway, California.

The head of Halle’s Jewish community, Max Privorozki, told news magazine Der Spiegel that a surveillance camera at the entrance of the synagogue showed a person trying to break into the building.

“The assailant shot several times at the door and also threw several Molotov cocktails, firecrackers or grenades to force his way in,” he said. “But the door remained closed — God protected us. The whole thing lasted perhaps five to 10 minutes.”

A video clip shown on regional public broadcaster MDR showed a man in a helmet and an olive-colored top getting out of a car and firing four shots from behind the vehicle from a long-barrelled gun.

Conrad Roessler said he was in the kebab shop when a man with a helmet and a military jacket threw something that looked like a grenade, which bounced off the doorframe. He said the man then shot into the shop.

“All the customers next to me ran, of course I did too. I think there were five or six of us in there,” Roessler told n-tv television. “The man behind me probably died.”

“I hid in the toilet,” he added. “The others looked for the back entrance. I didn’t know if there was one. I locked myself quietly in this toilet, and wrote to my family that I love them, and waited for something to happen.”

Police then came into the shop, he said.

Schuster offered his condolences to the relatives of “the two completely uninvolved people” who were killed and his sympathy to those were wounded. German authorities didn’t give any details on the victims.

The SITE Intelligence Group said the video on livestreaming site Twitch started with the assailant saying “my name is Anon and I think the Holocaust never happened.” He mentioned feminism and “mass immigration” and said that “the root of all these problems is the Jew.”

The video, which apparently was filmed with a head-mounted camera, showed the perpetrator driving up to the synagogue in a car packed with ammunition and what appeared to be home-made explosives.

He tried two doors and placed a device at the bottom of a gate, then fired at a woman trying to walk past his parked car. The assailant then fired rounds into the synagogue’s door, which didn’t open. He drove a short distance to park opposite the kebab shop. He fired at what appeared to be an employee, while customers scrambled away.

Twitch said it was “shocked and saddened” by the attack. “We worked with urgency to remove this content and will permanently suspend any accounts found to be posting or reposting content of this abhorrent act,” it said in an emailed response to a query about Wednesday’s events. It wasn’t immediately able to confirm who streamed the footage.

Twitch, owned by e-commerce giant Amazon, is best known as a site for watching others play video games, sometimes with commentary and tips for viewers. Wednesday’s attack appeared to be the first real-world violence livestreamed on Twitch, said Hannah Bloch-Wehba, a law professor at Drexel University. She said it was hard to guess why Twitch was chosen, although she noted that recent attempts by Facebook and Twitter to crack down on such material may be forcing attackers to look for new outlets.

Federal prosecutors, who in Germany handle cases involving suspected terrorism or national security, took over the investigation into the attack in Halle.

Authorities said shortly after the shooting that a person had been arrested, but advised residents to stay indoors for several hours as they worked to determine whether there were other assailants. They gave no information on the suspect but Der Spiegel and dpa, which cited unidentified security sources, said the suspect is a 27-year-old German citizen from Saxony-Anhalt state, where Halle is located. They identified him only as Stephan B.

Synagogues are often protected by police in Germany and have been for many years amid concerns over far-right and Islamic extremism, but Schuster said that there was no police presence outside the Halle synagogue on Wednesday.

“I am convinced that if there had been police protection there, in all probability the assailant would not have been able to attack a second site,” he said.

Security was stepped up at synagogues in other cities after the shooting in Halle.

SHOOTING NEAR SYNAGOGUE IN HALLE, GERMANY 0 150 KM POLAND Berlin NETHERLANDS GERMANY Halle BELGIUM CZECHIA FRANCE AUSTRIA HALLE PARACELSUSSTRASSE HUMBOLDTSTRASSE LUDWIG-WUCHERER-STRASSE Synagogue Martin Luther University of Halle-Wittenberg 0 250 m MURAT YUKSELIR / THE GLOBE AND MAIL, SOURCE: TILEZEN; OSM CONTRIBUTORS; HIU; GOOGLE MAPS SHOOTING NEAR SYNAGOGUE IN HALLE, GERMANY 0 150 KM Berlin POLAND NETHERLANDS GERMANY Halle BELGIUM CZECHIA FRANCE AUSTRIA REILSTRASSE HALLE PARACELSUSSTRASSE HUMBOLDTSTRASSE BERNBURGER STR. LUDWIG-WUCHERER-STRASSE Synagogue Martin Luther University of Halle-Wittenberg 0 250 m MURAT YUKSELIR / THE GLOBE AND MAIL, SOURCE: TILEZEN; OPENSTREETMAP CONTRIBUTORS; HIU; GOOGLE MAPS SHOOTING NEAR SYNAGOGUE IN HALLE, GERMANY DENMARK 0 150 KM Berlin BRITAIN POLAND NETHERLANDS GERMANY Halle BELGIUM CZECHIA SLOVAKIA FRANCE HUNGARY AUSTRIA PARACELSUSSTRASSE HUMBOLDTSTRASSE BERNBURGER STR. LUDWIG-WUCHERER-STRASSE HALLE Synagogue Martin Luther University of Halle-Wittenberg 0 250 m MURAT YUKSELIR / THE GLOBE AND MAIL, SOURCE: TILEZEN; OPENSTREETMAP CONTRIBUTORS; HIU; GOOGLE MAPS

German officials rushed to condemn the attack. Chancellor Angela Merkel visited a synagogue in Berlin on Wednesday evening in a show of solidarity.

“Shots being fired at a synagogue on Yom Kippur, the festival of reconciliation, hits us in the heart,” German Foreign Minister Heiko Maas said on Twitter. “We must all act against anti-Semitism in our country.”

The Jewish Federations of Canada-UIA and the Centre for Israel and Jewish Affairs said they are horrified by the attack.

“We are heartbroken, shocked, and furious to learn that the Jewish community of Halle was the target of a murderous antisemitic attack,” the groups said in a release.

“We join our partners from the Central Council of Jews in Germany in calling on German authorities for heightened police security around Jewish institutions in the country.”

The groups said Canadian law enforcement have indicated there is no information to suggest an elevated threat level in Canada, but as a precaution, police have increased patrols around Jewish institutions.

Anti-Semitism is a top concern in Germany, where reports of anti-Semitic incidents rose 10% last year, according to Tel Aviv University’s Kantor Center and where Merkel’s government earlier this year reaffirmed its commitment to protecting Jews who wear skullcaps from anti-Semitic threats.

Wednesday’s attack drew renewed calls from Jewish groups in the U.S. to step up co-operation in combating anti-Semitism. “We have been saying for several years that anti-Semitism is real, it’s resurgent, it’s lethal and it’s multi-sourced,” American Jewish Committee CEO David Harris said.

Noting that the attack in Halle comes on the heels of the one-year anniversary of an anti-Semitic shooting that killed 11 worshippers at Pittsburgh’s Tree of Life synagogue, he said such attacks “should be triggering alarm bells. The question is whether they are.”

Our Morning Update and Evening Update newsletters are written by Globe editors, giving you a concise summary of the day’s most important headlines. Sign up today.