A teenager who attacked a Jewish teacher in Marseille on Monday is a Turkish citizen of Kurdish origin who said he acted in the name of the militant Islamist group Islamic State, the prosecutor in the southern French city of Marseille said.

"He claimed to have acted in the name of Allah and the Islamic State, repeating several times to have done on behalf of Daesh (Islamic State)," the prosecutor, Brice Robin, told a news conference.

The 15 year-old, who was armed with a machete and a knife, wounded the teacher slightly before being stopped and arrested.

The teen invoked Allah and the extremist group only after he was detained, saying "the Muslims of France dishonor Islam and the French army protects Jews."

Interior Minister Bernard Cazeneuve earlier called the attack a "brutal anti-Semitic aggression."

The anti-terrorism section of the Paris prosecutor's office opened an investigation, meaning the scope of the act is viewed as not confined to anti-Semitism. The counts being investigated were aggravated attempted murder due to the victim's religion and in relation with a terrorist enterprise; criminal terrorist association; and death threats on those holding authority, the prosecutor's office said.

The boy attacked the teacher from behind, slashing him in the shoulder, and then went after the man again as he tried to flee, Robin said. The prosecutor, speaking at a news conference, said the attacker was known as a good student who appeared to have radicalized via the Internet without his parents being aware.

France has the highest Jewish and the Muslim populations in Europe and violent racial incidents have been in the spotlight since Islamic State claimed a coordinated series of attacks in Paris on November 13 in which 130 people were killed.

Authorities are also investigating the torching of two churches and the profanation of a mosque elsewhere in France.

Later Monday, Cazeneuve was visiting the Saint-Louis de Fontainebleau church, one of two damaged by fire on Sunday in the Paris region. Prosecutors opened an arson investigation. On Friday, Cazeneuve ordered a probe after a boar's head and racist inscriptions were found at Perpignan's main mosque.