The German immigrant who fatally stabbed one shopper and injured six more in July wanted to kill as many Christians as possible as part of "a worldwide jihad," prosecutors said Friday.

The 26-year-old Palestinian man, who has been identified only as "Ahmad A." due to German privacy rules, was arrested after the attack in Hamburg and charged with murder and attempted murder. Prosecutors gave chilling new details about the crime.

The suspect wanted to avenge injustices against Muslims around the world and so, according to federal prosecutors, decided to kill as many Christians as possible.

"The accused sought out his victims indiscriminately, retaliating against people who, in his view, represent perpetrators of injustice targeting Muslims," said prosecutors. "It was important to him to kill as many German nationals of the Christian faith as possible. He wanted his actions to be viewed in the context of an Islamist attack, and understood as a contribution to jihad worldwide."

Authorities previously revealed that Ahmad had come to Hamburg in 2015 from Norway. Federal officials asked Norway to take him back, but the request was filed one day after the deadline expired, and Norway refused.

Ahmad was still living as a refugee when he decided to kill Christian Germans indiscriminately. On July 28, he grabbed a kitchen knife off a supermarket shelf and began attacking shoppers around him before being overwhelmed by passersby and arrested. He cited tensions at the time over a contested Jerusalem holy site as his motivation for the attack.

Investigators found no evidence that the man was involved with any extremist group, or that any group like the Islamic State had supported him. But Hamburg officials were aware of him; they suspected him as a Islamic radicalist but not as a “jihadist.” They considered him psychologically unstable but did not think he posed any immediate threat.

At the time, Hamburg Mayor Olaf Scholz said he was particularly upset because of the suspect’s current refugee status.

“It makes me all the more angry that the perpetrator is apparently someone who sought protection here in Germany and then turned his hatred against us,” Scholz said.

The supermarket stabbing was the second attack from an asylum-seeker in Germany in a short period. In December 2016, a Tunisian man whose application for asylum had been rejected drove a truck into a Christmas market in Berlin, killing 12 people.

However, studies show that refugees in Germany are less likely to commit crimes than German citizens. The majority of the refugees who came to Germany in 2015 were between 14 and 30 years of age, which is the main demographic group responsible for a majority of crimes committed anywhere.