The anti-terrorism prosecutor’s office told The Associated Press the attack took place at 11 am in a commercial street in Romans-sur-Isere.
The alleged attacker was arrested by police nearby.
Prosecutors did not identify him.
They said he had no documents but claimed to be Sudanese and to have been born in 1987.
Prosecutors said that other people were also injured but couldn’t confirm French media reports that there were seven other casualties, of whom one is in critical condition.
They also did not confirm reports that the man had shouted Allahu akbar (God is great) as he carried out the attack.
The office said it is evaluating whether the attack was motivated by terrorism, but that it has not launched any formal proceedings to treat it as such.
Like the rest of France, the town’s residents are on coronavirus-linked lockdown.
The victims were carrying out their weekend food shopping on the street that has bakeries and grocers, the office said.
Two-meter distancing is being encouraged as in the rest of the country.
Media reported that the attacker first went into a tobacco shop and stabbed the tobacconist and two customers, before attacking several other people in the vicinity of that shop and a nearby bakery.