A teenager armed with a machete has attacked a Jewish teacher in southern France, invoking the Islamic State group and saying he had also planned to go after police.

The 15-year-old Turkish Kurd was arrested soon after attacking the teacher, who was injured in the outdoor attack in central Marseille, according to prosecutor Brice Robin.

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

He attacked the teacher first from behind, slashing him in the shoulder, and then went after the man again as he tried to run away, Mr Robin said.

The knife attack comes just days after a man armed with a butcher knife was shot to death after authorities said he went after police in central Paris.

That man's identity has not yet been confirmed but German authorities say he had lived at a shelter for asylum-seekers in the western city of Recklinghausen.

Both incidents coincide with high tension in France, which last week marked a year since the January attacks against the Charlie Hebdo newspaper and a kosher supermarket that left 17 people dead.

Over the weekend, two churches were burned and a boar's head and racist inscriptions were found on Friday at Perpignan's main mosque.

PA Media