Marseille (AFP) - Two people were hurt in a town in southern France on Sunday when a woman shouting "Allahu akbar" (God is greatest) attacked them in a supermarket with a boxcutter knife, prosecutors said.

A customer was struck in the chest during the late-morning assault in La Seyne-sur-Mer, outside the Mediterranean port of Toulon, but the wound is not life-threatening, prosecutor Bernard Marchal told AFP.

A woman working at a checkout counter was also cut over her eye. Both casualties were taken to hospital.

"It appears to be an isolated case by a person with known psychological problems," Marchal said, "though that doesn't exclude the possibility that she may have been radicalised."

"Several witnesses have quoted her as saying it was Allah who told her to do it, that they were all miscreants and that she wanted the police to kill her," the prosecutor said.

He added that "contrary to what was said at the start, she was not wearing a veil, but a black tunic over black trousers and black glasses."

France has been on high alert following a string of jihadist attacks since early 2015, often by people who have become radicalised or claim to have acted in the name of the Islamic State group.

The 24-year-old assailant, who did not have a police record, was overpowered by a customer and two supermarket employees and taken into custody.

"I grabbed her wrists to get hold of the cutter," said the customer, an electrician who gave only his first name, Sebastien.

"I asked her 'Why did you do it.' She did not answer."

The woman "was in a panic, she was afraid, she did not understand what was happening to her, she had no strength left," Sebastien said.

Police later searched her home to determine if she had any links to the Islamic State group, but Marchal said they found only an old Koran and an Algerian flag. A computer was seized from the studio where she lived a few kilometres (miles) from the shop.

"We don't yet know if this is a terrorist act, but in any case it was terrifying," Marchal said.

Story continues

The woman, who carried a physical handicap card, would undergo a psychiatric assessment.

More than 240 people have been killed in jihadist attacks since the massacre at the Charlie Hebdo satirical magazine in Paris in January 2015.

Last month a knifeman shouting "Allahu akbar" killed one person and wounded four others during a Saturday night attack in central Paris.

In March, a Franco-Moroccan man shot dead three people, including a policeman, at a supermarket in the southern town of Trebes before being killed by police. He had also killed the passenger of a car he hijacked in nearby Carcassonne.