PARIS (Reuters) - A man suspected of carrying out a knife attack in the French city of Marseille, in which two women were stabbed to death, had been arrested and then released by police the day before the incident, the Paris public prosecutor said on Monday.

French police and soldier secure a street near the Saint-Charles train station after French soldiers shot and killed a man who stabbed two women to death at the main train station in Marseille, France, October 1, 2017. REUTERS/Jean-Paul Pelissier

The prosecutor, Francois Molins, told a news conference that the suspect, who was shot dead by a French soldier, went by seven different identities. One such identity named him as “Ahmed H”, born in 1987 in Tunisia.

He had shown a Tunisian passport when last stopped by police in the city of Lyon on Sept. 29 on suspicion of robbery. He was subsequently released by police for lack of evidence on Sept. 30, the day before Sunday’s attack.

“The attacker had been pointed out on seven different times since 2005, under seven different identities. The last time, on September 29, related to an arrest in Lyon over shoplifting,” Molins told a news conference.

Molins said none of the suspect’s seven different identities had thrown up any alert on French anti-terrorist check lists. The authorities were trying now to establish his real name and the authenticity of the Tunisian passport he had shown.

Police sources said the suspect had shouted “Allahu Akbar” (God is greatest) in Arabic as he attacked the women at Marseille’s main railway station on Sunday, in what officials described as a “probable terrorist act”.

The militant Islamic State group claimed responsibility for the attack but did not name the assailant. Molins did not confirm or deny any suspected involvement by Islamic State.

Molins added that the suspect had told police he lived in Lyon, was homeless, divorced and had problems with drug abuse.

The assailant was shot dead by a soldier from the military Sentinelle patrol, a force deployed across the country under a state of emergency declared after Islamist militant attacks began almost two years ago.

Multiple attacks by militants killed 130 people in Paris in 2015. In 2016 a gunman drove a truck into a crowd celebrating Bastille Day in Nice, killing 86 people. Both of these attacks were claimed by Islamic State.