Germany: A man shoots in the streets of Halle an der Saale, eastern Germany. (AFP)

Highlights Gunman kills 2 outside a synagogue in eastern German city of Halle

The gunman made a 35-minute video of his attack in Halle

The gunman streamed the shootout video on the gaming site Twitch

A gunman killed two people outside a synagogue in the eastern German city of Halle on Wednesday, apparently filming his attack on a head-mounted camera in a method that had chilling echoes of a far-right attack on two New Zealand mosques earlier this year.

At the beginning of the 35-minute video, a man in a green jacket that matches eyewitness accounts introduces himself as "Anon." He denies the Holocaust and lists what he sees as the world's problems, including feminism that leads to low birthrates and immigration.

"The root of all these problems is the Jew," he says in the video, which was streamed on the gaming site Twitch and shared with The Washington Post by the International Center for the Study of Radicalization.

The man swears repeatedly and apologizes to his video audience as his plan appears to go awry, at points blaming his homemade weapons.

When a locked door keeps him from gaining entry to the synagogue packed with worshipers for Yom Kippur, he shoots a woman in the street and a man at a nearby kebab shop.

German authorities said they had one suspect in custody and were investigating a video.

A German security official, who spoke on condition of anonymity to discuss an ongoing investigation, confirmed that the gunman had recorded the attack on a head camera.

The official said the suspect was a 27-year-old from Benndorf, Germany, who was not known to police or intelligence and claimed he was acting alone.

"This is definitely the same modus operandi as Christchurch," the official said.

Brenton Tarrant, the 28-year-old white supremacist charged with shooting dead 51 people in Christchurch, New Zealand, in March, also recorded the attack on a head-mounted camera and streamed it.

But the Germany shooter lacked Tarrant's firepower, limiting the fatalities.

Deadly synagogue attacks in Pittsburgh and in Poway, California, have rocked the Jewish community in the United States, while the number of anti-Semitic hate crimes has risen significantly in Germany and other European countries.

Earlier this year, an anti-Semitism representative for the German government sparked controversy when he said it might not be safe for Jews in Germany to wear traditional kippah skullcaps in public.

A man walks with a gun in the streets of Halle an der Saale, eastern Germany. (AFP)

Wednesday's attack drew quick condemnation. "We have to fight against anti-Semitism in our country," tweeted German foreign minister Heiko Maas. "My thoughts are with the dead and injured, their relatives, and the police in these difficult hours."

German Chancellor Angela Merkel attended a vigil in a Berlin synagogue Wednesday evening, her office said.

In a statement, Israeli Prime Minister Benjamin Netanyahu called the attack "another manifestation of the anti-Semitism in Europe."

Twitch, the gaming site, said in a statement that it was "shocked and saddened by the tragedy" in Germany, adding that it had a "zero tolerance policy against hateful conduct."

"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," the company said.

The company reported that a recording of the stream was viewed by about 2,200 people in the 30 minutes before the video was flagged and removed from the platform.

(Twitch is owned by Amazon, whose chief executive, Jeff Bezos, also owns The Washington Post.)

The SITE Intelligence Group, which tracks online extremism, reported that white supremacist communities online had applauded the attacker.

There were about 75 worshipers in the synagogue at the time of the attack, Max Privorozki, chairman of the local Jewish community, told Der Spiegel. He described watching a gunman attempting to enter the synagogue via its security cameras.

Synagogues in Germany are often guarded by armed police.

In the video, the man arrives at the building to find the doors locked. He returns to his vehicle to retrieve what appears to be an improvised explosive device, but it fails to get him inside.

Giving up on the synagogue, he shoots a woman on the street, but his weapon misfires, as it does throughout the attack, when he attempts to shoot another person.

"Sorry guys," he tells his video audience as he drives off. "I tried to kill some," he adds, trailing off.

He stops when he arrives at a kebab shop.

"All the customers next to me ran," said a witness interviewed by German broadcaster n-TV. The witness said there were five or six people inside at the time. "I locked myself quietly in the bathroom. I wrote to my family that I love them," he said.

In the footage from inside the shop, the shooter again repeatedly misfires but hits one man.

By the time police arrive, about 15 minutes have passed since the man in the video approached the synagogue. Police shoot him, but he escapes and continues to drive.

"I'm a complete loser," he says, before the video ends with him appearing to lie in the street for several minutes as vehicles drive by.

Germany's federal prosecutor took over the investigation, a move spokeswoman Carolin Urban said "means that one can assume that this case is of relevance to the security of Germany."

Before the video emerged, Urban told reporters, "Whether this case had an anti-Semitic motive still has to be determined. We do not exclude any possibility."

The area was put on lockdown after the attack, with police initially reporting that multiple attackers had fled the scene. The security official said that as of Wednesday evening police on the ground believed it was more likely one perpetrator.

Authorities urged those in the area to stay in their homes or office buildings; all public transport was halted. Drago Bock, a spokesman for the city, said Halle had been on a state of "high alert" from early.

"All emergency services have been deployed," he said.

In the neighboring federal state of Saxony, authorities sent additional police units to protect synagogues, a spokesman confirmed.

The U.S. ambassador to Germany, Richard Grenell, said 10 Americans were inside the synagogue at the time of the attack. "All are safe and unharmed," he tweeted.

In Germany, there have been about 1,500 anti-Semitic verbal and violent attacks annually in recent years, but researchers say the actual figures are higher. One recent survey found that about 70 percent of anti-Semitic incidents go unreported, according to researchers at the Technical University of Berlin.