"Two victims have been stabbed to death," regional police chief Olivier de Mazières told AFP. The Interior Ministry has announced that both victims were women.
The knife-wielding suspect was then shot dead by military police patrolling the Mediterranean port city's main train station, according to local prosecutor Xavier Tarabeux.
French counterterrorism prosecutors have opened a probe into the attack, as reported by AFP.
Authorities have evacuated the station due to an ongoing police investigation.
The attack took place around 1.45pm local time, or 11.45am GMT.
Police have urged people to avoid St Charles station and the surrounding area in a tweet posted soon after the attack.
"Anger and sadness for the victims," Prime Minister Edouard Philippe said in a tweet. He also expressed support for the military personnel and police "who protect us".
"We won't let down our guard."
Colère et tristesse pour les victimes. Soutien aux militaires et policiers de Sentinelle qui nous protègent. Nous ne baissons pas la garde.Edouard Philippe (@EPhilippePM) October 1, 2017
Interior Minister Gérard Collomb announced in a tweet that he will be heading to Marseille.
#Marseille : après l’attaque perpétrée à proximité de la gare Saint Charles, je me rends immédiatement sur les lieux.Gérard Collomb (@gerardcollomb) October 1, 2017
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.
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.
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.
Interior Minister Gérard Collomb defended the law before the lower house of parliament on Monday. He said it would guarantee "individual and collective liberties while ensuring all measures are taken to ensure France's security."
President Emmanuel Macron assured critics in September by announcing that the bill, if signed into law, "will be re-evaluated in 2020". According to Macron, this means certain articles could be scrapped or modified.
Bill opposed by human rights groups
Human Rights Watch criticised the bill in a report published Monday, saying it "normalises emergency practices".
"It takes elements of emergency practices – intrusive search powers, restrictions on individuals that have bordered on house arrest, closure of places of worship – that have been used abusively since November 2015, and makes them normal criminal and administrative practice."
The report adds that the law would "[weaken] the judiciary’s control over and ability to check against abuse."
Amnesty International has also opposed the bill.
"France should focus on restoring a state of normalcy instead of seeking to embed these repressive measures into ordinary law," John Dalhuisen, the group's Europe director, said Monday.
France roiled by attacks
Since 2015, more than 200 people have been killed in terror attacks in France.
An attack on the Paris offices of satirical magazine Charlie Hebdo in January 2015, which left 12 dead, was followed later that year by the coordinated attacks on Paris bars and the Bataclan concert hall that left 130 dead.
In the Mediterranean city of Nice in July 2016, a man rammed a truck through a crowd gathered for France's national day, killing 86.
There have also been smaller attacks carried out against police officers, soldiers or other members of the public.
France is part of the US-led international coalition fighting against the Islamic State armed group in Iraq and Syria.