MAINZ, Germany — Two people were shot to death and several more were injured Wednesday on the Jewish holy day of Yom Kippur when a gunman opened fire near a synagogue and a nearby kebab shop and posted the livestreamed violence online.

There were 80 people inside the synagogue in the city of Halle when the heavily armed suspect tried to get inside, the German interior minister, Horst Seehofer, said in a statement obtained by NBC News.

"We have to assume that we are at least [dealing with] an anti-Semitic attack," although authorities do not yet have "a final evaluation" of the crime, he said.

Ten Americans were inside the synagogue at the time and none of them were hurt, U.S. Ambassador Richard Grenell posted on Twitter.

We have identified 10 Americans who were inside the synagogue at the time of the attack, all are safe and unharmed. https://t.co/bDP8V5mmfu — Richard Grenell (@RichardGrenell) October 9, 2019

The suspected gunman was later arrested, a police spokesman told the German news channel NTV.

Der Spiegel Online, a German media outlet, reported that German security services have a video from the shooter’s helmet camera.

Video was posted on white supremacist channels

In the livestream and later a video that was posted online, a man introduces himself as “Anon,” a wink to an anonymous message board known to host racist and misogynistic content, looks into the camera, and gives a short speech in which he denies the Holocaust, and decries feminism, immigration and the existence of Jewish people.

Most of the video is in German but when the shooter speaks to the camera, he uses English.

The 35-minute video shows the man parking near the synagogue and trying to enter the door, which is locked. As he tries to enter the building, he shoots a woman walking in the road. After he is unable to enter the synagogue, he drives to the kebab shop. His gun appears to malfunction but he shoots one person inside.

He continues shooting at random targets in the street before driving away and discarding his phone on the side of the road.

The shooting was first livestreamed on the gaming platform Twitch, the company confirmed to NBC News. Twitch took down the livestream within minutes, but it had already been captured as a video and posted online.

Within minutes of the video getting posted at 5:50 p.m. local time, it had spread across at least 10 white supremacist Telegram channels to tens of thousands of users, many of whom hailed the shooter as a hero and a saint.

Telegram is an encrypted messaging app known for its use by members of the Islamic State militant group to spread propaganda.

The shooting was the latest to be livestreamed and posted online. In March, a gunman recorded his massacre of 51 people at mosques in Christchurch, New Zealand. Social media platforms have struggled to contain the spread of such violent content, which serves as a recruitment tool for future extremists.

“There is absolutely a trend toward using Telegram to spread this kind of stuff as propaganda,” said Megan Squire, a computer science professor at Elon University who tracks online extremism.

A Twitch spokesperson told NBC News, “We are shocked and saddened by the tragedy that took place in Germany today, and our deepest condolences go out to all those affected. Twitch has a zero-tolerance policy against hateful conduct, and any act of violence is taken extremely seriously. We are working with urgency to remove this content and permanently suspend any accounts found to be posting or reposting content of this abhorrent act.”

Synagogue was evacuated

Pictures and video, shared on social media out of Halle and verified by NBC News, show the shooter in an olive-colored military-style jacket, helmet and long gun roaming local streets.

Soon after the shooting, a city spokesman said an emergency situation was declared and all residents were advised to remain at home. He said emergency services and police were evacuating people from the synagogue.

All first responders in Halle, including police officers, firefighters and ambulance services, were put on high alert.

National rail operator Deutsche Bahn closed down the main train station in Halle shortly after the gunfire erupted.

Police secure the area after a shooting in the Germany city of Halle on Oct. 9, 2019. Marvin Gaul / Reuters

Police were also investigating gunfire that erupted Wednesday about 10 miles east, in the city of Landsberg, officials said.

Officials decry attack

The country's federal prosecutor took over the investigation of the shooting due to its "extraordinary importance" because of the possibility of it being a "right-wing extremist crime."

“I am deeply shocked by this act [of violence], which I vigorously condemn," Seehofer, the interior minister, said in the statement obtained by NBC News. "It is a heinous attack on our peaceful coexistence. My thoughts are with the victims and their families and I wish the injured a speedy and full recovery.”

“It hits us in the heart that shots are fired at a synagogue on the day of reconciliation," German Foreign Minister Heiko Maas tweeted.

The U.S. Embassy in Berlin said it "strongly" condemns the shootings which it called "an attack on all of us."

The United Nations secretary-general's spokesman condemned the attack as "another tragic demonstration of anti-Semitism — perpetrated on the holy day of Yom Kippur — which needs to be fought with the utmost determination."

German Chancellor Angela Merkel's spokesman, Steffen Seibert, told reporters during a regular government press conference, "This is terrible news from Halle, and I hope very much that the police catch the perpetrator, or perpetrators, as quickly as possible."

Eckardt reported from Mainz, Germany; Li from New York; and Radnofsky and Bailey from London.