The main suspect in a Marseille attack in which two women were stabbed to death had been arrested and let go in Lyon two days before the assault at the train station, authorities said. His details turned out to be tied to seven IDs in criminal databases.

Last Friday, the man was detained in Lyon on suspicions of shoplifting, Paris prosecutor Francois Molins said at a press conference Monday. He was nabbed at Lyon Part-Dieu shopping center after being accused of stealing a jacket, but was released the following day due to insufficient evidence.

In Lyon, the man showed a Tunisian passport issued in the name of ‘Ahmed H.’, born in 1987, according to Molins. During the arrest the suspect claimed he was divorced, unemployed and didn’t have a permanent place to stay in Lyon.

Molins added the suspect was reported to the authorities seven times since 2005 under seven different identities that were added to criminal databases, but he wasn’t known to anti-terrorist services.

Earlier, a source contributing to the police investigation told Reuters the man had eight aliases: “Each time he was stopped, he presented a different identity paper. That's why it's so difficult. At one moment, he says he was born in France, at another he says he was born in Algeria."

READ MORE: ISIS claims responsibility for Marseille knife attack that killed two people

The investigation is currently underway to ensure the authenticity of the ID submitted in Lyon, which the Marseille suspected attacker didn’t have on him at the time of the attack.

On Sunday, two women were killed at the Marseille main train station of Saint-Charles by the man, who reportedly shouted “Allahu Akbar.” An army patrol soldier shot the attacker dead at the scene. The victims were reportedly two cousins aged 17 and 20, with one of them having her throat slit and the other stabbed in the stomach.

Islamic State (IS, formerly ISIS/ISIL) claimed responsibility for the incident via its propaganda channel Amaq.