The Islamic State released a video on Tuesday showing the extremist who wielded an axe during a train attack in Germany, in which he boasts how he would carry out a “martyrdom operation” that would make the world forget about the terror attacks in France.

The video, provided to FoxNews.com by the Middle East Media Research Institute (MEMRI), shows the attacker, 17-year-old Afghan refugee Muhammad Riyad, waving a knife around as he describes how he planned to attack “unbelievers” while on German soil.

"I am one of the caliphate's soldiers, and I will carry out a martyrdom operation in Germany,” Riyad is seen saying on the video in the Pashto language. “Oh unbelievers, the time when you come to our countries and kill our men, women and children is over. There was no one to hold you responsible for that [previously], and the apostate rulers [in those countries] were silent towards those massacres. And no Muslim would dare to come out against you, even verbally. [But] that time is over.”

The militant also spouts how the Islamic caliphate has grown and that their soldiers eventually permeate throughout the west and carry out jihad.

“And the Islamic caliphate soldiers shall reach you, inshallah, and shall slaughter you on your soil, reside in your homes, bases, and land,” he says. They shall build [their] bases on your land, and target you in every village, city, and every airport, inshallah. Realize that the Islamic caliphate has become strong today, and [that] it will target your parliaments.”

He also gloats about hiding in plain sight and foreshadowed Monday’s violent attack.

“And here I was, living among you and in your homes, and planning to [attack] you [while] on your soil,” he says. “And I shall slaughter you in your homes and alleys, and by the will of Allah, I will make you forget the horror of France's operation. Allah's willing, I will fight you as long as I am alive, and I will slaughter you with this knife and will cut off your head with axes, inshallah.”

The video comes as ISIS claimed responsibility for the ax-and-knife attack near Wurzburg, Germany that left at least five people injured. Two of the victims have life-threatening injuries.

On Tuesday, German prosecutors say that the 17-year-old Afghan asylum seeker learned over the weekend that a friend had been killed in Afghanistan.

The teenager shouted "Allahu akbar" ("God is great") as he attacked people on the regional train Monday night, and a hand-painted flag of the Islamic State was found during a search of his room, according to state Interior Minister Joachim Herrmann. Riyad was fatally shot by police as he tried to flee the scene.

Though the Islamic State group claimed responsibility and released the video through its Aamaq news agency, Herrmann said the suspect, whose identity has not been released, had written notes in his native Pashto that indicated he may have been self-radicalized.

The Associated Press contributed to this story.

Perry Chiaramonte is a reporter for FoxNews.com. Follow him on Twitter at @perrych