(REUTERS) – A teenager who attacked a Jewish teacher in France with a machete was sentenced to seven years in jail on Thursday by a French juvenile court, judicial sources said.

The 17-year-old was convicted at a closed-doors trial for slightly wounding the teacher who was wearing a traditional Jewish skullcap, or yarmulke, while walking to school in January 2016 in the southern city of Marseille.

Prosecutor Brice Robin said shortly after the attack that the teenager, who has not been identified because of his age, said he had acted in the name of the Islamic State militant group.

The teenager, a Turkish citizen of Kurdish origin, was 15 at the time of the attack. He was charged with attempted murder in connection with a terrorist attack, with the aggravating factor of anti-semitism.

(Read more from Reuters here)