Police officers secure the area after a bomb attack in Ansbach, Germany. (Matthias Schrader/AP)

The Islamic State on Tuesday released a video in which the purported suicide bomber who struck the German city of Ansbach gives a pre-attack diatribe, prompting authorities to intensify their investigation into his apparent links to the extremist group.

It is not clear to what extent the Islamic State was involved in planning and assisting in the attack, or whether it was a lone-wolf operation.

A day earlier, the Islamic State asserted responsibility for the Sunday attack, in which the assailant — a rejected Syrian asylum seeker identified as 27-year-old Mohammed Daleel — triggered a backpack bomb, killing himself and wounding 15 people.

In the subsequent video, which was released by a news agency tied to the Islamic State, a man purported to be Daleel vows that Germans “will never sleep well again.”

An image released by a group affiliated with the Islamic State shows Mohammed Daleel, who German authorities said detonated a bomb near a music festival in the city of Ansbach. (Amaq News Agency/via AFP/Getty Images)

Frauke Köhler, a spokeswoman for the attorney general’s office in the city of Karlsruhe, acknowledged that the video was the same as one authorities found on the bomber’s cellphone.

She said authorities were investigating the extent of the bomber’s communication with and links to the Islamic State, as well as whether he had accomplices in Germany.

“We’re wondering whether he had help building the device,” she said. “Just because you have knitting instructions doesn’t mean you can knit.”

In the video, the man, whose face is covered by a black scarf, speaks in front of a white curtain, vowing to attack Ansbach in retaliation for the “killing and displacing of Muslims.” He threatens Germans repeatedly, pledging that “next time, it won’t be [explosive] belts but car bombs.”

The attack was the fourth mass-casualty assault on German soil in less than a week — including three involving migrants and two claimed by the Islamic State. Besides the Ansbach bombing, the extremist group also asserted responsibility for an attack in which a 17-year-old ax-wielding Afghan asylum seeker wounded five people on a Bavarian commuter train July 18.

The attacks have fueled a growing sense of foreboding in Germany, which until recently had largely avoided the wave of terrorism that has struck its neighbors.

Authorities are still probing the background of Daleel, who applied for asylum in Germany in 2014. He was issued deportation orders later that year after authorities found out that he had earlier applied for, and received, refugee status in Bulgaria. He was due to be sent back to that country, but his deportation was delayed because of his mental health.

He is on record as having twice attempted suicide and had been detained by police for drug possession and other minor offenses.

On Monday, authorities discovered bombmaking materials in the refugee shelter where he lived.

Officials also noted that Sunday’s bombing could have been much worse. Daleel’s backpack was rigged with metal projectiles, and he had tried to enter a music festival where 2,000 people were gathered, but he lacked a ticket and was turned away. He ultimately detonated his bomb near a wine bar in a less-crowded square.

The biggest mystery is how Daleel was radicalized and whether his contact with the Islamic State began before or after his arrival in Europe.

According to the German tabloid Bild, which obtained a copy of his asylum file, the Syrian man told German officials that he was a Sunni Muslim and had come from Aleppo. He had studied law for one semester and worked in his father’s soap factory.

“A missile had damaged our house, I was heavily injured and brought to Turkey,” he claimed in his asylum application.

Daleel said he left Syria on July 16, 2013. From there, he told authorities, traffickers drove him to Bulgaria, where he filed an asylum request in September 2013.

On April 17, 2014, he said, he flew from Sofia to Vienna on Austrian Airlines, Flight OS 806, Seat 22A, with one suitcase. Austrian police seized him, he told German authorities, and “took my documents.” On April 20, he said, he applied for asylum in Austria but then decided to go to Munich on July 5, where he also applied for asylum in Germany.

Daleel said he had been arrested several times in Syria, by the government and by groups linked to al-Qaeda, allegedly because he had published videos of demonstrations. He told German authorities that his wife and children had died and that his house had been bombed. He said his parents were arrested for demonstrating against the government.

It is not clear what parts, if any, of his story were true.

“I fear death and humiliation,” he told German officials. “I don’t want to carry a weapon against people. I’m afraid to return to Syria, because I could become a murderer.”