AN ISIS knifeman who killed two cousins during a bloody attack in Marseille had been arrested by cops one day earlier - but was released.

The terror group said its "soldier" launched a frenzied knife rampage at Gare Saint Charles — while screaming "Allahu Akbar", according to witnesses.

31 Panic unfolded at Marseille's main station after a knifeman slit a woman's throat and stabbed another in the stomach

31 Forensics officers inspect the knifeman's body outside Gare Saint Charles Credit: Getty - Contributor

31 The attacker stabbed to death two women before he was shot by soldiers Credit: Getty - Contributor

31 A forensic official works around a body covered by a white sheet outside Saint Charles station Credit: AP:Associated Press

31 Investigators inspect the body of the dead attacker that ISIS claims is one of its 'soldiers' Credit: Getty - Contributor

31 Police work through the cordoned crime scene near the body of one of the stabbing victims Credit: Getty - Contributor

The man shouted ‘Allahu Akbar’ as he murdered the 17-year-old student and 21-year-old nurse outside St-Charles station in the southern city of Marseille on Sunday afternoon.

Neither the man, who was aged between 30 and 35, nor his female victims have been formally identified but all have links with the city of Lyon, which is 250 miles north of Marseille.

Passengers were evacuated by armed police on Sunday afternoon after soldiers fatally shot the killer knifeman — a known criminal believed to be in his 30s.

Now it had emerged the attacker – who was a North African of either Algerian or Tunisian origin – was arrested in Lyon for shoplifting on Friday.

He had no papers on him and was in ‘an irregular situation in Europe’, so giving the authorities a chance to place him under judicial control.

31 French policemen turn over and hold the knife attacker, a known criminal who is believed to be in his 30s Credit: AFP or licensors

31 Police investigators work outside the Saint Charles train station after French soldiers shot and killed a knifeman Credit: AFP or licensors

"Instead they let him go, and the next they heard about him was in connection with a double murder,’ said an investigating source in Marseille."

A statement from the ISIS's propaganda agency said: "The executor of the stabbing operation in the city of Marseille... is from the soldiers of the Islamic State."

But French investigators have so far held back from declaring the attack in France's second city as terrorism — and ISIS have in the past claimed responsibility for killings that it had no hand in planning.

Witnesses have told of the traumatic moments the attacker pounced on the two women before charging at soldiers who opened fire, fatally wounding him.

"We heard two shots and saw people rushing down the stairs from the station", said Ninon Bornet, a chef a cafe beside the station told Le Parisien.

"We brought in all our customers, we barricaded ourselves in the restaurant".

31 Two women were stabbed to death outside the fcity's biggest station on Sunday Credit: AP:Associated Press

31 The area surrounding St Charles station has been cordoned off as forensics assess the scene Credit: Reuters

31 The station was evacuated about 2pm on Sunday after an attacker allegedly screamed 'Allahu Akbar' Credit: AFP or licensors

31 Emergency services and military swarmed the scene in the southern French city today Credit: AFP or licensors

Another told of "the smell of gunfire" in the air moments after the attacker was felled by two soldiers as he charged at them.

"Outside the soldiers and plainclothes policemen held the crowd", said 29-year-old Arthur.

"Two policemen in bulletproof vests and armed with assault rifles screamed instructions before leaving very quickly".

"I heard someone shout 'Allahu Akbar' and I saw a man who seemed to be dressed all in black," Melanie Petit, an 18-year-old student, told AFP news agency.

Other travellers around the station described "controlled panic" as security forces evacuated passengers and looked for possible accomplices, while another witness said white sheets were placed over the bodies of the victims.

"There were police everywhere," said Francois Jacquel, a retired traveller who was in a waiting room.

Cops scrambled to the scene in southern France at around 2pm local time on Sunday, sparking an immediate mass evacuation.

Confirming the injuries and fatalities, Oliver de Mazieres, a local official, said: "Two victims have been stabbed to death".

Neither have yet been identified, but a police source said they were "in their 20s".

31 Armed police and soldiers lock down the area around the station Credit: AFP or licensors

31 Travellers were prevented from entering the station as a cordon was set up in the wake of the attack Credit: Reuters

31 French soldiers shot the knifeman to death after two women were savagely killed Credit: AP:Associated Press

31 Local police confirmed two women were murdered during the afternoon onslaught Credit: AP:Associated Press

31 Cops rushed to evacuate commuters out of the busy station in southern France Credit: Zack Ismaili‏

"The attack was frenzied," said an investigating source. "The man first shouted threats, and then launched into the two women.

"The two were killed by a knife, and then soldiers on anti-terrorism duties intervened. They shot the man dead. At least one large butcher’s knife was used by the attacker."

The servicemen were deployed as part of Operation Sentinel, a wide-ranging security initiative that has flooded French streets with around 7,000 soldiers.

Police sources claimed the incident is likely to be a terror attack, although this is yet to be confirmed.

Locals were urged to stay away from the area, with the scene described as as a "major police incident".

"There was screaming and shouting, and people were running everywhere," said one witness.

"People were picking up children, and trying to help those who weren’t very good on their feet. They just wanted to get away."

Another female witness called Hajar told FranceInfo: "I heard two shots, that was what triggered the panic.

"People came out of a waiting room shouting 'Run! Don't stay in the station. Everybody outside.'

"I had just got to the station when everyone started running. People sitting on the terrace of a fast food restaurant came inside and shouted 'Run, get out! Then I saw a woman on the floor, they were giving her CPR."

31 Saint Charles station was evacuated and locked down within minutes of the attack Credit: Reuters

31 Train passengers were blocked from entering the crime scene in Marseille Credit: Reuters

31 Officers guard a stairway towards the promenade around the station where the knifeman was shot Credit: AFP or licensors

31 A heavily armed security official parades the scene around Saint Charles station Credit: AFP or licensors

31 Initial reports of gunshots and a roaming knifeman sparked a swift evacuation at Marseille train station Credit: Twitter

31 Passengers who were rushed out of the station look on as the scene unfolds Credit: AP:Associated Press

31 French Interior Minister Gerard Collomb greeted emergency responders and spoke to the media outside the Saint-Charles train station Credit: Reuters

Anti-terror officials have launched an investigation into the "killings linked to a terrorist organisation".

President Emmanuel Macron said he was "deeply outraged" by the "barbarous" knife attack, while his prime minister Edouard Philippe praised the soldiers who shot the suspect and stopped the "killing frenzy".

French interior minister Gerard Collomb rushed to Marseille to liaise with authorities.

Speaking to reporters at the police cordon, he said video footage obtained by investigators showed the attacker knifing the two women before he charged at soldiers and was shot.

"This act could be terrorist in nature but at this time we cannot confirm that," he added.

The knife rampage comes as France is still on high alert following a string of deadly terror attacks which began in January 2015.

Before this incident, 239 people were killed by Islamist extremists over the last two years in France.

After the November 2015 terror attack, which unfolded at the Bataclan concert hall, then President Francois Hollande declared a state of emergency.

Security forces received increased power to use force and launch prompt anti-terror raids.

31 Crowds of shocked passengers gather near the scene on Sunday Credit: AP:Associated Press

31 Police instruct bystanders to stay back from the scene of the brutal knife attack Credit: AP:Associated Press

31 Commuters are left waiting outside the station after their travel plans have been wrecked Credit: AP:Associated Press

31 Cops described the attack as a major police incident Credit: Zack Ismaili‏

31 Officials examine the scene of the ambush which started around 2pm local time Credit: AP:Associated Press

There have also been a series of smaller onslaughts in France.

A knifeman attacked a soldier at a Paris Metro station last month, but he was swiftly arrested.

In August, a man driving a van killed a person and left another injured after he mowed a bus stop down in Marseille.

Sunday's incident comes days after Islamic State released a recording of a man they claimed was Abu Bakr al-Baghdadi - the terror network's leader - urging his followers to strike their Western enemies.

31 A French soldier continues to guard the station as emergency service workers help passengers Credit: AP:Associated Press

31 The area surrounding St Charles station has been cordoned off as forensics assess the scene Credit: Reuters

We pay for your stories! Do you have a story for The Sun Online news team? Email us at tips@the-sun.co.uk or call 0207 782 4368 . We pay for videos too. Click here to upload yours.