‘He has done nothing wrong in the past and has been a really good headteacher.

‘I also feel sorry for his children and his family for having to go through all of this.’

Another parent, who also wanted to stay anonymous, said: ‘Mr Gilmour is really good – as a parent I have never had a problem with him.

‘In my opinion, after school hours he can do anything he wants – we all have our own private lives.

‘The punishment is fair but he doesn’t deserve to be treated so badly be people because of it.

‘We all make mistakes.’

In a statement from The Thinking Schools Academy Trust, a school spokesman said: ‘Our priority at all times is providing the very best education, and we worked closely with Iain and his union to put in place a structured programme to support him to accelerate school improvement. This had been having a positive impact.

‘Last month, a member of staff was charged with offences by police. He was suspended immediately ahead of today’s court appearance, where he pleaded guilty and was sentenced.

‘We will now commence disciplinary procedures in line with our policy, and it would not be appropriate to discuss this further at this stage.’