ISIS has released a chilling video of the Afghan refugee who went on an axe rampage on a German train where he says he will attack the country in revenge for airstrikes against the terror group.

The attacker, who is named in the footage as Muhammad Riyad, was gunned down by armed police after fleeing the scene near the city of Wurzburg, 70 miles north of Nuremberg last night.

He is believed to be 17 years old although in the video, it appears he could be much older.

It has been revealed he moved to Germany two years ago and had been living with a foster family in Ochsenfurt for the past two weeks.

He shouted 'Allahu Akbar' during the incident and ISIS has claimed responsibility, making it the first attack by the terror group in Germany.

The 17-year-old attacker, who has been named as Muhammad Riyad by ISIS, was gunned down by armed police after fleeing the scene near the city of Wurzburg, 70 miles north of Nuremberg last night

As many as 19 passengers needed hospital treatment while three victims are fighting for their lives after being attacked with 'cutting and stabbing weapons'.

An eyewitness said the train, which had been carrying around 25 people, looked 'like a slaughterhouse' after the rampage, with blood covering the floor.

In the video released by ISIS and filmed before the stabbing, the teenager says he will carry out the attack and threatens 'infidel' countries.

Knife in hand, he then announces in Pashto, an Afghan language, he would carry out an 'operation' in Germany, and presents himself as a 'soldier of the caliphate'.

He says: 'I am one of the soldiers of the Islamic Caliphate, and I am going to conduct an attack in Germany. It is about time to stop you from coming to our homes, killing our families, and getting away with it.

The axe that Riyad used to injure his victims is recovered by police at the scene of the attack earlier today

Gruesome pictures taken in the hours after the attack show the blood-soaked interior of the train

German police carry the body of the Afghan train attacker is carried from carriage and into a hearse after he was shot dead by police

'Our apostate politicians have never tried to stop you, and Muslims have never been able to fight you back or even speak against what you do. But these times are gone now.

'With the Islamic Caliphate now instated in Iraq, Sham, Khorasan, Libya and Yemen, its soldiers will be able to attack and slaughter you in your homelands, and they will take your nations as homes and military bases for them.

TRANSCRIPT OF ATTACKER'S CHILLING RANT I am one of the soldiers of the Islamic Caliphate, and I am going to conduct an attack in Germany. It is about time to stop you from coming to our homes, killing our families, and getting away with it. Our apostate politicians have never tried to stop you, and Muslims have never been able to fight you back or even speak against what you do. But these times are gone now. With the Islamic Caliphate now instated in Iraq, the Levant, Khorasan, Libya and Yemen, its soldiers will be able to attack and slaughter you in your homelands, and they will take your nations as homes and military bases for them. They will also target you wherever you are, in every village, city or airport. And I here warn you, that the Islamic Caliphate is now powerful enough to target your parliaments, and I am the proof of how powerful it became. I have been living with you all the time while planning an attack that will be stronger than the Paris attacks that continue to horrify you to this day. I will keep fighting you as long as I am alive, I will slaughter you with this knife, and I will decapitate you with an axe. And to the Muslims all over the world, I say: 'How long are you going to remain that passive. The Islamic Caliphate is now well established, so this is the time to declare your loyalty to the Caliph Abu Bakr Al Baghdady, and to migrate to Khorasan as well as the other Islamic State cities. 'There are also Islamic State cities all over the world, so if you can’t go to the Levant (Sham), then start killing all of the apostate armies in your countries.' Advertisement

'Know this, that the Islamic State is powerful and has your parliaments in its sights.

I would advise you not to forget the spectacular attacks in France. I will fight you so long as I live and I will slaughter you with this knife and I will cut through your throats with this axe.'

Police have now recovered the axe the teenager used in his assault and removed his body from a field, where it had been left since he was shot dead last night.

However, officers have yet to confirm if he is indeed called Muhammad Riyad. But they did say the attacker had learned over the weekend that a friend had been killed in Afghanistan.

German authorities said they had found a hand-painted ISIS flag and what they called a suicide letter among the asylum seeker's belongings

The flag and the note are believed to have been discovered in the house he was living in with a foster family.

There were also books in English and German about Islam found in his room and a written farewell to his father among his possessions.

It said: 'Pray for me that I can take revenge on these infidels and pray for me that I will go to heaven.'

He had been placed with a couple just two weeks ago after living for nearly two years in a hostel run by the Catholic Kolpingwerk charity.

Bavarian interior minister Joachim Hermann said that the teenager came to Germany as an unaccompanied minor, and applied for asylum in March.

He lived in a home for teenage refugees until he was placed with the foster family.

Neighbours in the street adjacent to the centre recalled a 'confused' young man who never marked himself out as a fanatic of any stripe.

'He always looked worried' recalled Hannelore Lenz.

'But then the Afghans here often did. The government changed the rules about offering their asylum and they were always perpetually worried about if they were going to be allowed to stay.'

Another who would not give her name said: 'The relationship with the refugees was always harmonious here.

'I do remember seeing this young man around town - not very tall, very intense dark eyes, always a little troubled looking. But I never thought him capable of this.'

People in Ochsenfurt said he was seen in a nearby mosque on 'high days and holidays' but was by no means regarded as deeply religious.

A stain of blood and the remains of a bandage lie on the pavement close to where the axe attack happened in Germany

Investigation: Police stand by the regional train on which a teenager wielding an axe attacked passengers

A 17-year-old Afghan refugee went on the rampage with an axe and a knife on a train in Germany. He was later shot dead by police

Edmund Au Yeung (right) suffered severe injuries as he tried to protect his girlfriend Tracy Yau Hiu-tung (left). They are shown together in picture on Edmund's Facebook page

Police have refused to reveal the names of his foster parents but they are known to be worshippers at the Catholic Kreuzkirche in the centre of the town and registered with the charity that had looked after the youngster to provide a home for him.

The case is likely to deepen worries about so-called 'lone wolf' attacks in Europe and could put political pressure on German Chancellor Angela Merkel, who has welcomed hundreds of thousands of migrants to Germany over the past year.

German officials didn't identify the victims, but Hong Kong's immigration department said among those wounded were four members of a family of five from the southern Chinese city.

The dpa news agency reported the attacker wounded the 62-year-old father, the 58-year-old mother, their adult daughter and her boyfriend. The teenage son was not hurt.

The father and the boyfriend had tried to defend the other family members, dpa said.

Eyewitnesses said Riyad swung the axe into the stomach of one of his victims in a bid to disembowel him after going into the bathroom and arming himself.

Local reports said it was the 31-year-old boyfriend of the Hong Kong victims' daughter who was most gravely injured as he slashed at passenger's bodies and heads.

The South China Morning Post named Edmund Au Yeung as having suffered severe injuries as he tried to protect his girlfriend Tracy Yau Hiu-tung.

This morning police officers search for evidence in a field near to the railway station close to Nuremburg

Germany had thus far escaped the kind of large-scale jihadist attacks seen in the southern French city of Nice last week

Meanwhile an eyewitness, who declined to give his name, said he saw people crawl from the carriage and ask for a first-aid kit as other victims lay on the floor inside.

The onslaught started on the train from Treuchtlingen to Würzburg as the service stopped at Würzburg-Heidingsfeld.

The attacker boarded the train in Ochsenfurt at 8pm for the hour long journey.

Apparently Riyad chose that train because it was often used by a female social worker who had helped him in the past.

Someone pulled the emergency cord when the train was in the Wuerzburg suburb of Heidingsfeld, just behind a quiet street called Roethenweg.

Melanie Göttle and Günter Karban heard screams in their garden shortly after 9.15.

Their garden borders on the tracks and the pair ran out through a narrow gate to try to aid the wounded who were screaming.

The rampage onslaught started on the 9pm train from Treuchtlingen to Würzburg as it stopped at Würzburg-Heidingsfeld

Germany's best-selling newspaper, Bild (left) carries the story at the bottom of its front page under the headline: 'Rampage on the train! Suspect shot', while the Bielefeld-based Neuw Westfalische carried the story at the top of its front page under a headline which said 'Travellers attacked on a train'

'The paramedics brought the injured on stretchers through our garden to the ambulances,' said Miss Göttle.

She, her husband and neighbors helped as best they could, bringing out blankets and towels.

'We gave them hot sweet drinks before police sent most of us back into our homes,' said Melanie.

'The Asian man looked quite terrible,' she added Melanie. 'I hope so much that he survives the attack.'

As well as the two critically injured victims, one other passenger is believed to have non life-threatening injuries while 14 others suffered minor injuries or shock.

A police spokesman said: 'Shortly after arriving at Wuerzburg, a man attacked passengers with an axe and a knife.

'Three people have been seriously injured and several others lightly injured.'

As well as the three critically injured victims, one other passenger is believed to have non life-threatening injuries while 14 others suffered minor injuries or shock

The Bavarian interior ministry confirmed that police had shot and killed the attacker and a special task force has been dispatched from Wurzburg

He added: 'The perpetrator was able to leave the train, police left in pursuit and as part of this pursuit, they shot the attacker and killed him.'

There were no further details on the circumstances of the teenager's death, and police declined to suggest what the motive was for the attack.

'At this time everything is possible,' the spokesman said.

Train services had come to a halt between Wurzburg-Heidingsfeld and Ochsenfurt and a police helicopter circled the area.

The Bavarian interior ministry confirmed that police had shot and killed the attacker and a special task force has been dispatched from Wurzburg. Police believe the attacker worked alone.

The train line near the city of Wurzburg in southern Germany has been closed and police have descended on the scene

The teenager was eventually shot dead by police after he tried to attack them with a 'knife or hatchet'

Joachim Herrmann, the interior minister of Bavaria state, said the attacker was a 17-year-old Afghan who had lived in nearby Ochsenfurt

Germany had thus far escaped the kind of large-scale jihadist attacks seen in the southern French city of Nice last week, in which 31-year-old Mohamed Lahouaiej Bouhlel used a truck to mow down people leaving a Bastille Day fireworks display, killing 84 people in an attack claimed by ISIS.

In May, a mentally-unstable 27-year-old man carried out a similar knife attack on a regional train in the south, killing one person and injuring three others.

Early reports suggested he had yelled 'Allahu Akbar' but police later said there was no evidence pointing to a religious motive. He is being held in a psychiatric hospital.

Germany let in a record nearly 1.1 million asylum seekers last year, with Syrians the largest group followed by Afghans fleeing ongoing turmoil and poverty in their country.

The number of refugees arriving in Germany has fallen sharply as a result of the closure of the Balkans migration route and an EU deal with Turkey to stem the flow.

Police, fire and ambulance crews were all dispatched to the scene of the axe attack this evening

There were no further details on the circumstances of the teenager's death, and police declined to suggest what the motive was for the attack

In April, May and June, the number was around 16,000 each month, less than a fifth of the tally seen at the start of the year, according to official figures.

Bavaria is governed by the Christian Social Union (CSU), sister party to Chancellor Angela Merkel's conservative Christian Democrats.

The CSU has been loudly critical of Merkel's welcoming stance toward asylum seekers, a split that threatened the unity of the ruling coalition in Berlin and sent the government's approval ratings plunging.

It has also lent support to a right-wing populist party, Alternative for Germany, which was founded as a Eurosceptic protest party in 2013 but now mainly rails against Islam and Germany's refugee influx.