A police officer stands guard while passengers enter the Marseille Saint Charles train station, a day after a man fatally stabbed two women outside the train station, in Marseille, southern France, Monday, Oct. 2, 2017. The assailant was killed by soldiers immediately after the attack, the latest of several targeting France. (AP Photo/Claude Paris)

A police officer stands guard while passengers enter the Marseille Saint Charles train station, a day after a man fatally stabbed two women outside the train station, in Marseille, southern France, Monday, Oct. 2, 2017. The assailant was killed by soldiers immediately after the attack, the latest of several targeting France. (AP Photo/Claude Paris)

PARIS (AP) — A man who fatally stabbed two women outside Marseille’s main train station had been detained for shoplifting and released the day before the attack, and used seven fake identities in previous encounters with police, officials said Monday.

French authorities are studying the suspect’s cellphone and working to determine his true identity and whether he had direct links to the Islamic State group, which claimed responsibility for Sunday’s stabbing. The assailant was killed by soldiers immediately after the attack, the latest of several targeting France.

ADVERTISEMENT

The suspect was identified by his fingerprints, which matched those taken during seven previous incidents registered by police since 2005, Paris Prosecutor Francois Molins told reporters.

The attacker didn’t have any past convictions in France, Molins said. The man’s most recent arrest occurred in the Lyon area Friday — just two days before the train station stabbing.

The man was held overnight for shoplifting, then released Saturday and the charges dropped, Molins said. He added that local authorities had no reason to hold him further based on the ID he gave them — a Tunisian passport.

French Interior Minister Gerard Collomb, apparently not satisfied with the explanation, on Monday ordered a probe of the circumstances that led police to free the man, who attacked and killed the young women a day later. The report is due by week’s end, a ministry statement said.

While being held in Lyon, the man told police that he did odd jobs, used hard drugs and was divorced, according to Molins, the prosecutor. It’s not clear if the attacker had any connection to the victims — two cousins who had met for a birthday celebration.

Some witnesses reported hearing the assailant shout “Allahu akbar!” — Arabic for “God is great” — and Molins said that’s one of the reasons prosecutors opened a terrorism investigation. But no firm evidence has surfaced linking the man to Islamic extremism.

Molins said video surveillance of the site showed the man sitting for a few minutes on a bench outside the station, before jumping up and stabbing one woman several times. He then ran away and returned to attack the second woman.

A woman passer-by tried to intervene, Molins said. The man then tried to attack soldiers patrolling the site, but they shot him dead with two bullets.

The suspect was found with two knives and a telephone, but no identity papers, according to Molins.

ADVERTISEMENT

The man’s multiple pseudonyms made it difficult to even find a house to search for more clues, said Yves Lefebvre of the Unite SGP Police union.

“While it could shock the public, unfortunately it doesn’t shock us, the police” that the suspect was released the day before carrying out a deadly attack, he said. He said shoplifting usually results in a quick police report and a court summons, and the suspect is released.

“Nothing allowed us to suspect there was a threat of radicalization during the (Lyon) arrest,” Lefebvre told The Associated Press. He said that while the man didn’t provide a residency permit, jails and migrant retention centers are often overflowing, so authorities do not routinely lock up illegal immigrants suspected of minor crimes.

However, the interior minister demanded a report to “shed full light” on the man, procedures followed and the decision not to expel him, the ministry statement said.

The IS-linked Aamaq news agency said that the assailant was acting in response to the extremist group’s calls to target countries in the U.S.-led coalition fighting militants in Syria and Iraq. France has been part of the anti-IS coalition since 2014. The Aamaq statement didn’t provide details, and it’s unclear if the claim is merely opportunistic.

The small town of Eguilles in southern France held a memorial gathering Monday evening for the victims, a medical student from Eguilles, identified as 20-year-old Mauranne, and her cousin, Laura. Villagers gathered to sign a book of condolences. Officials have withheld the young women’s last names.

Marseille’s Saint Charles station reopened Monday under heavy security. Last month, four American college students were attacked with acid at the same station by a woman authorities said was suffering from mental illness.

___

Sylvie Corbet contributed to this report.