Halle, Germany (CNN) Streaming live from a camera mounted on his helmet , a gunman pushed on the doors of a synagogue, fired several shots at a lock on the door, stuck an explosive in a door jam and lit it.

But he couldn't get in.

The fact that the door held likely spared the lives of the dozens of people inside the synagogue on Yom Kippur, the holiest day in the Jewish calendar.

Police say the gunman killed two people Wednesday in the eastern German town of Halle -- one directly outside the synagogue, and one at a nearby kebab shop. Police have arrested the suspected gunman.

A 35-minute video of the apparent attack posted online shows the suspected gunman, who had what appeared to be explosives in his car, trying to break down the synagogue doors, cursing in frustration and driving away.

Watching all this unfold on the synagogue's security cameras were the 51 people barricaded inside at the time, Max Privorozky, the head of Halle's Jewish community, told CNN.

"We were very, very, very afraid," Privorozky told CNN. The group could see that "somebody was killed," he added, referring to the body of a woman who was the attacker's first victim.

It took around 10 minutes for police to arrive, said Privorozky. Thankfully, the building had "good doors" that were "better than weapons," he added.

'Scandalous' lack of security

The attack has raised serious concerns about the safety of Germany's Jewish community.

It comes amid a rise in anti-Semitic attacks in recent years, and a surge in support for far-right parties in the east of the country where the shooting happened.

Jewish community leaders are now questioning why the synagogue wasn't under police guard.

"The fact that the synagogue in Halle was not protected by the police on a holiday like Yom Kippur is scandalous," said Josef Schuster, president of Germany's Central Council of Jews, in a statement.

In Germany's major cities -- like Berlin or Munich -- many Jewish institutions have a police guard to protect them from such attacks.

Not so the synagogue in Halle, a city with a population of more than 230,000.

The head of Germany's police union, Oliver Malchow, cast doubt on the feasibility of that level of protection throughout the country.

"We'd have to guard every synagogue, every church, every mosque, every holy place in Germany around the clock," he told Germany's public television, Reuters reported.

"So I don't know if this was a mistake or if this really couldn't have been foreseen."

Anti-Semitism on the rise

Anti-Semitic attacks are on the rise in Germany. Earlier this year, German Jews were warned by a leading government official not to wear traditional kippahs in all public settings, following a rise in attacks across the country.

Data released by the interior ministry revealed that anti-Semitic hate crimes rose by nearly 20% from 2017-18, while the number of physical attacks against Jews increased from 37 in 2017 to 69 last year.

A far-reaching CNN investigation into anti-Semitism across Europe last year revealed more worrying trends: about one in five people in Germany surveyed said Jews had too much influence in the media.

Meanwhile, the country has seen a surge in support for far-right parties like the Alternative for Germany (AfD), particularly in eastern states where the attack happened.

The anti-immigrant group has been widely criticized for using rhetoric reminiscent of Nazi Germany , with AfD politician Bjoern Hoecke previously calling Berlin's Holocaust memorial a "monument of shame," in comments reported by Reuters.

Hoecke condemned the Halle attacks.

The party was accused of inciting a culture of hatred, by president of the Jewish Community in Munich, Charlotte Knobloch.

"This assassination shows once again how fast extremist words become deeds," Knobloch said on Twitter.

Shooting live-streamed

After failing to enter, the gunman drove away and opened fire at a kebab shop less than a half-mile away, killing one person, police said.

The video, which was filmed from the shooter's perspective, bears striking resemblance to the video filmed by the suspect in the March attack on two mosques in Christchurch, New Zealand . The suspected gunman in that incident livestreamed a nearly 17-minute video of the attack.

CNN is not showing the video.

A spokesperson for Twitch confirmed to CNN that the video was streamed live on their platform. The site is most commonly used to livestream video games.

"Twitch has a zero-tolerance policy against hateful conduct, and any act of violence is taken extremely seriously," the company said in a statement.

This image shared on social media shows the alleged gunman.

In the video, the suspect, who wore dark clothing and gloves, launches into an anti-Semitic rant, claiming the Holocaust "never happened" and saying that the Jews are the root of some of the world's problems.

A 27-year-old German suspect, known only as Stephan B., has now been detained following Wednesday's shooting rampage. But a "long-term solution" to xenophobia in Germany sorely needs to be addressed, according to survivors.

The country needs "a change in society, educating people. Anti-semitism doesn't affect just Jews -- it's xenophobia," said Christine Feist, originally from Vienna, with Base Berlin, the group of 10 Americans who were inside the synagogue.

"People are lighting candles -- but this is just a small part of society," she told CNN.