The teacher was stabbed in the side and throat while preparing for his class at a school in Aubervilliers, northeast of Paris, but his life was not in danger, the police source said.
The attacker was dressed in painter’s overalls and a balaclava and arrived without a weapon but grabbed what appeared to be a box cutter that was lying in the classroom.
According to local prosecutors the man shouted: “This is Daesh. This is a warning.” Daesh is another name for IS.
The brief exchange was reported by a witness working inside the school.
The attacker fled after stabbing the teacher and the probe has been taken over by anti-terrorist investigators.
The Islamic State’s French-language magazine Dar-al-Islam called in its November edition for its followers to kill teachers in the French education system, describing them as “enemies of Allah” for teaching secularism and “in open war against the Muslim family.”
The attack comes as Paris is on high alert after a wave of shootings and suicide bombings at Paris nightspots on November 13 that killed 130 people and left 350 injured.
Security has also been boosted at schools.