Two women were stabbed to death and their assailant shot dead by a soldier in the southern French port city of Marseille on Sunday in what officials described as a "likely terrorist act".

Police sources said the suspect had shouted "Allahu Akbar" (God is greatest) in Arabic as he attacked the women, aged 17 and 20, at Marseille's main railway station.

Two police sources said one had her throat slit while the other was stabbed in the chest and stomach.

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

"We have until now managed to avoid such dramatic incidents (in Marseille). I think it was a terrorist attack and the individual who was killed seems to have had several identities," Marseille mayor Jean-Claude Gaudin told reporters.

Paris was rocked in 2015 by multiple attacks that killed 130 people. 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.

Other countries, including Britain, Germany and Belgium, have also suffered attacks by militants using knives, guns, explosives and driving vehicles at crowds.

Some 200 police officers cordoned off the area and all roads were closed to traffic.

A witness told Reuters she saw a man take out a knife from his sleeve and then stab a young girl and then a second woman, shouting what could have been "Allahu Akbar".