A deputy head teacher has avoided being struck off, despite being hauled before a disciplinary panel after giving pupils lewd nicknames at their leaving assembly.

Graeme Cowie publicly labelled a number of pupils – including a girl with learning disabilities – with “sexual” names, at Mearns Academy, Laurencekirk, last year.

Mr Cowie, who was acting head teacher at Inverurie Academy at the time, was reported to the General Teaching Council for Scotland and faced a hearing last week.

The panel heard how the 38-year-old – who is now depute rector at Gordon Schools, Huntly – had used a random name generator which he found on the internet.

Mr Cowie – who had been invited back to the school after previously working there – also claimed one pupil had wet themselves in first year and made an indecent joke and swore during his speech to fifth and sixth year pupils in April last year.

The maths and physics teacher, who has a 17-year career, had admitted using inappropriate language and acting inappropriately in front of pupils.

He also admitted he had used language that was “sexual in nature” to pupils and being disrespectful towards colleagues.

However, he denied he was unfit to teach, claiming his “ego” took over during the “worst 15 minutes of his career”.

Following the speech, Mr Cowie was removed from his position by Aberdeenshire Council.

The hearing panel determined that Mr Cowie’s fitness to practice was impaired but he could remain as a teacher.

Their written decision said: “The respondent had fallen significantly short of the standards expected at the time and, in the panel’s view, public confidence in teaching as a profession would be undermined if no order were made.”

Mr Cowie was placed on a conditional registration for a year, whereby he will have to inform any future employer about his offence, tell the GTCS if he moves school and provide the organisation with regular written reports on his behaviour and conduct.

He was also given a reprimand, which is effectively a note on his registration, for the same period.

Last night, Aberdeenshire Council confirmed it would consider the panel’s findings.

Head of Secondary Education and Additional Support, Vincent Docherty, said: “After the reported incident, Mr Cowie was immediately suspended and the matter was thoroughly investigated by Aberdeenshire Council.

“This resulted in his demotion and transfer to another school and the matter was referred to the General Teaching Council.

“We will now consider the decision of the procedural hearing and take appropriate action.”