Residents who went out to shop while the city was locked out were stabbed to death.
It is understood that the attack took place at 11 am local time on a shopping street in Romans-sur-Isère.
Police arrested the alleged attacker nearby. He was not identified by prosecutors, but they said he had no documents and claimed to be Sudanese and to have been born in 1987.
One of the victims is in critical condition, according to reports in the French media. It is not yet known whether the attack was linked to terrorism.