A man went on a knife rampage in a town in southeastern France on Saturday, killing two people in what is being treated as a terrorist attack.

The attack in broad daylight, which President Emmanuel Macron called "an odious act", took place with the country on lockdown in a bid to stem the spread of the deadly coronavirus.

The reasons behind the stabbing spree remain unclear although Interior Minister Christophe Castaner spoke of the suspect's "terrorist journey" and counter-terrorism prosecutors are now leading the investigation.

The assailant, understood to be a refugee from Sudan in his 30s, was arrested after his rampage in a string of shops in Romans-sur-Isere, a riverside town with a population of about 35,000.

According to witnesses cited by local radio station France Bleu Drome Ardeche, he shouted "Allah Akbar!"(God is Greatest) as he attacked his victims.

David Olivier Reverdy, assistant national secretary of the National Police Alliance union, said the assailant had called on police to kill him when they came to arrest him.

"All the ingredients of a terrorist act are there," he told BFMTV.

The suspect first went into a tobacco shop where he attacked the owner, town mayor Marie-Helene Thoraval told AFP.

"His wife got involved and she was wounded as well," she said.

The assailant went on the attack in several stores in the southeastern French town of Romans-sur-Isere
The assailant went on the attack in several stores in the southeastern French town of Romans-sur-Isere AFP / JEFF PACHOUD

The assailant then went into a butcher's shop where he seized another knife before heading to the town centre where he entered another store.

"He took a knife, jumped over the counter, and stabbed a customer, then ran away," the shop owner Ludovic Breyton told AFP.

"My wife tried to help the victim but in vain."

Castaner, who visited the scene, said two people were killed and five others injured.

"This morning, a man embarked on a terrorist journey," he said.

The initial investigation has "brought to light a determined murderous course likely to seriously disturb public order through intimidation or terror", according to the national anti-terrorist prosecutor's office (PNAT).

It said that during a search of the suspect's home, "handwritten documents with religious connotations were found in which the author complains in particular that he lives in a country of non-believers".

Macron was quick to denounce the attack in a statement on Twitter.

"All the light will be shed on this odious act which casts a shadow over our country which has already been hit hard in recent weeks," he said.

France is in its third week of a national lockdown over COVID-19, with all but essential businesses ordered to shut and people told to stay at home.

The country has been on alert for terrorist attacks since a wave of deadly jihadist bombings and shootings in Paris in 2015.