A teacher in Scotland who told students that “Hitler wasn’t all bad”, because he killed gay people, has been struck off.

David McNally told a Higher class: “Hitler wasn’t all bad – he killed the Jews, the gays and the disabled”.

He went on to say to a third-year Religious Education class that he would “rather have been a prison warden or a child abuser”, according to the General Teaching Council (GTC).

Pupils subsequently complained to their parents about the comments, which were made at Kilwinning Academy, Ayrshire, in November 2012.

McNally, a supply teacher, was found to be unfit to teach at the GTC hearing, at which he was not present. He accepted that he had made the remarks in his written submission.

In it, he wrote that he was having a “particularly bad day” and that he had made the comments in a “general sense”. This was rejected by the GTC.

Among other comments, McNally also asked pupils: “Did you have sex at the weekend?”, as well as saying: “I love my mobile phone because I can sit and watch porn on it.”

He also reportedly said: “I have a part-time job at a children’s home – they have taught me how to whip a child with a wet towel without leaving a mark.”

McNally was struck off the teaching register, and cannot reapply to teach for two years.

In its decision, the panel said: “The panel had regard to the detailed submissions made by the respondent.

“The panel rejected the suggestion that the comments had been made in a general sense.

“It noted that the pupils had reacted to the comments by reporting the matter to their parents.

“The panel was of the view that the explanations by the respondent did not reduce their gravity and considered that, under any circumstances, they were entirely inappropriate.”

McNally may appeal once he receives written notification of the GTC’s ruling.