When the teacher at the Kurt-Tucholsky School extended her hand to congratulate a Muslim student on passing his Abitur exams (the German A-Level equivalent), the student declined, offering his wrist instead.
He explained to her privately that his actions weren't due to a lack of respect, but for religious reasons, local media reported.
However, when he went on to refuse to shake the female headteacher's hand, some members of staff felt he had crossed a line. Several teachers wanted the student to be sent out from the event, but headteacher Andrea Lüdtke refused.
Five teachers decided to boycott the rest of the event and there were "intense discussions" among teachers and students, the Hamburger Morgenpost reported.
Lüdtke told the local paper that the student was a committed and enthusiastic pupil in religious studies as well as in other subjects, adding that he was "in no way" extremist.
"We are now considering how to show that we cannot tolerate such behaviour," she said, adding that it was the first time that shaking hands had been an issue at the school.
However, the problem has arisen before elsewhere in Germany, a country where the handshake is ingrained into the culture.
In June, an imam took his child out of a Berlin private school after a meeting with a teacher, when he explained he wouldn't be able to shake her hand and she said he should "adapt to the culture".
And in Switzerland, debate as to whether it is acceptable for Muslim students to refuse handshakes on religious grounds has been rumbling on since April, when a school in the north of the country decided that two Muslim students did not have to shake the hand of their female teachers. The decision provoked so much outcry that the school later brought in a legal expert to decide whether it was valid.