He was detained Friday for shoplifting in the eastern French city of Lyon and released the next day, Paris prosecutor François Molins announced during a press conference on Monday.
Investigators in Marseille were able to establish that the suspect had a previous record of petty crime based on his fingerprints, which matched those taken during previous arrests.
According to Molins, he had been arrested on seven different occasions since 2005. However, he had given a different pseudonym each time he had been in police custody, so investigators have not yet been able to confirm his true identity.
While in custody in Lyon, the suspect gave police a Tunisian passport. The passport indicated his name was Ahmed H, and that he was born in 1987 in Tunisia.
However, this passport has not yet been verified.
"Nothing allowed us to suspect there was a threat of radicalisation during the (Lyon) arrest," police union official Yves Lefebvre told the Associated Press (AP).
Two police officials who spoke to AFP on condition of anonymity added that none of the suspect's seven aliases were on France's extremist watch list.
Molins added that a mobile phone was found near the suspect's body, and that investigators in Marseille's St Charles train station, where Sunday's attack took place.
IS claims responsibility
The Islamic State armed group (IS) said Sunday night that it was responsible for the attack.
The group's propaganda arm, Amaq, claimed the suspect was "from the soldiers of the Islamic State."
Investigators have not yet confirmed if the suspect was indeed linked to IS.
Some witnesses said they heard the suspect shout "Allahu Akbar" before the attack, according to local media.
The suspect fatally stabbed two women in their 20s in the Mediterranean port city's St Charles train station on Sunday afternoon. They were cousins, according to the investigation.
The man then ran towards military police who were patrolling the station, who shot him dead.
French President Emmanuel Macron tweeted Sunday that he was "deeply angered by this barbaric act."
Attack comes days before counterterrorism bill vote
The attack came two days before French MPs are set to vote on a counterterrorism bill that would turn certain aspects of the temporary powers granted under the state of emergency into law.
Under the bill, as under the state of emergency, authorities would be able to search properties and place people on house arrest without a warrant from a judge.
This marks the longest uninterrupted state of emergency in France since the Algerian War of Independence.
The government has argued that the new counterterrorism bill is necessary to keep certain security measures in place, as the state of emergency cannot be extended indefinitely.
Human rights groups have opposed the bill, saying it reduces judicial oversight over the actions of the police.
The lower house of parliament will vote on the bill on Tuesday, 3 October.
France roiled by attacks
France has been under a state of emergency since the 2015 terror attacks in Paris that left 130 dead. It was renewed for a sixth time in July, and is set to expire at the end of October.
Since 2015, more than 200 people have been killed in terror attacks in France.
France is part of the US-led international coalition fighting against the Islamic State armed group in Iraq and Syria.