SOLINGEN, Germany (AP) — A Syrian man on Sunday was ordered held on suspicion of murder and membership in a terrorist organization in connection with the Solingen knife attack that left three dead and eight wounded at a festival marking the city’s 650th anniversary.

A judge at the Federal Court of Justice in Karlsruhe ordered 26-year-old Issa Al H. held pending further investigation and a possible indictment after federal prosecutors said that he shared the radical ideology of the Islamic State extremist group — and was acting on those beliefs when he stabbed his victims repeatedly from behind in the head and upper body.

The ruling came after the suspect turned himself in, saying that he was responsible for the attack, police said. He is also suspected of attempted murder and serious bodily injury, prosecutors said. His last name wasn't released in line with German privacy rules.

The suspect, wearing handcuffs and leg shackles, was taken Sunday from the police station in Solingen for the initial court appearance.

He “shares the ideology of the foreign terrorist organization Islamic State” and on the basis of his “radical Islamic convictions” decided “to kill the largest possible number of those he considers unbelievers” at the festival, the Office of the Federal Prosecutor said in a statement.

The suspect is a Syrian citizen who had applied for asylum in Germany, police confirmed to The Associated Press. The dpa news agency reported, without citing a specific source, that his asylum claim had been denied and that he was to have been deported last year.

On Saturday, the claimed responsibility for the attack, without providing evidence. IS said on its news site that the attacker targeted Christians, and that the perpetrator carried out the assaults Friday night “to avenge Muslims in Palestine and everywhere.”

The attack comes amid debate over immigration before regional elections on Sept. 1 in Germany’s Saxony and Thuringia regions where anti-immigration parties such as the populist Alternative for Germany are expected to do well. In June, Chancellor Olaf Scholz vowed that the country would start deporting criminals from Afghanistan and Syria again after a knife attack by an Afghan immigrant left one police officer dead and four other people injured.

Friday's attack plunged the city of Solingen into shock and grief. A city of about 160,000 residents near the bigger cities of Cologne and Duesseldorf, Solingen was holding a “Festival of Diversity” to celebrate its anniversary.

People alerted police shortly after 9:30 p.m. local time Friday that a man had assaulted several people with a knife on the city’s central square, the Fronhof. The three people killed were two men, ages 56 and 67, and a 56-year-old woman, authorities said. Police said that the attacker appeared to have deliberately aimed for his victims’ throats.

The festival, which was due to have run through Sunday, was canceled as police looked for clues in the cordoned-off square. Instead, residents gathered to mourn the dead and injured, placing flowers and notes near the scene of the attack.

“Warum?” — meaning “why” — asked one sign placed amid candles and teddy bears.

Among those asking themselves the question was 62-year-old Cord Boetther, a merchant fron Solingen.

“Why does something like this have to happen? It’s incomprehensible and it hurts,” Boetther said.

IS declared its caliphate in large parts of Iraq and Syria about a decade ago, but now holds no control over any land and has lost many prominent leaders. The group is mostly out of global news headlines.

Still, it continues to recruit members and claim responsibility for , including lethal earlier this year that killed dozens of people. Its still carry out attacks on government forces in both countries as well as U.S.-backed Syrian fighters.

—Ĕ

David McHugh contributed from Frankfurt.

The ɫֱ Press. All rights reserved.