A teacher who gave pupils "porn star nicknames" during a speech at a leavers' assembly has been given a formal reprimand by a teaching watchdog.

Graeme Cowie also referred to a "sexting epidemic" among pupils during the speech at Mearns Academy in Laurencekirk, Aberdeenshire.

Colleagues were said to be "shocked" after his speech in front of the S5 and S6 pupils in April last year.

Mr Cowie appeared before the General Teaching Council for Scotland (GTCS) in May, when he admitted charges of using inappropriate language in front of pupils.

During the speech, Mr Cowie said he had put each of the final-year pupils names through a website which generated "porn star names".

He then read out a list of 62 explicit names at the assembly, singling out one female pupil and telling her: "I am quite surprised at your name given your reputation."

Colleagues told the GTCS hearing the girl had been involved in a child protection incident around sexting.

In another part of his speech, Mr Cowie said "let's not mention the sexting epidemic", but he later told the GTCS panel he did not mean to single out a specific pupil.

Another part of the speech made reference to a pupil wetting himself, which caused the pupil in question to "cringe."

Giving evidence, the school's head teacher David Martindale said pupils at the assembly were "lapping it up" and there "was an element of showmanship involved."

Depute head teacher Angela Wotherspoon said she was "a bit traumatised by it all" and the staff were "in a state of shock."

One pupil told her parent Mr Cowie had made a "career wrecking" speech.

At the hearing, Mr Cowie he "deeply regretted" his course of action and took full responsibility for the offence and upset he had caused.

He described himself as a "passionate teacher of 17 years" and said his "emotions, ego and arrogance" took over and he lost control of the situation.

The GTCS panel noted Mr Cowie had a "long and unblemished career" before he gave the speech.

Issuing him a reprimand, the panel said his conduct "fell significantly short of the standards expected of a registered teacher."