Teachers in Germany have set off a national controversy after they boycotted their own school’s leavers’ ceremony in protest at a Muslim pupil who refused to shake hands with a female member of staff.

The teachers demanded that the teenage pupil, who has not been named under German privacy laws, be excluded from the ceremony over the incident.

But he won the backing of the school’s head teacher, who insisted he be allowed to attend.

The row at the Kurt Tucholsky secondary school in Hamburg has renewed debate in Germany over whether religious pupils can be forced to shake hands with teachers of the opposite sex.

The dispute began at the end of an oral examination for the Abitur, the German equivalent of A levels. The teacher conducting the exam held out her hand to the pupil to congratulate him, but he refused to shake it and offered her his wrist instead.

He asked to speak to her alone, and told her “I’m not doing this out of disrespect, but for religious reasons”.

Several teachers then demanded he be excluded from the end-of-term ceremony for those who had passed the exams as a punishment.

Andrea Lüdtke, the head teacher, refused. “He is by no means a radical or extremist,” she told Hamburger Morgenpost newspaper.