A former assistant housemaster at a boarding school used by royals and the rich and famous has been found guilty of grooming pupils.

Disgraced Andrew Keir, 67, who lives in the Tarporley area, was convicted of a string of lewd and indecent offences involving 13-year-old boys in his care almost three decades ago.

A sheriff took just 20 minutes to find the retired physics teacher at Gordonstoun, Morayshire, guilty of the charges after a three-day trial at Elgin Sheriff Court in Scotland.

Immediately after the verdict the school - where Prince Philip and his sons Charles, Andrew and Edward were taught - apologised.

A spokeswoman said: “During the trial it became clear that the school’s response at the time of the offences was not as robust and rigorous as it would be now, and we are very sorry for this.

“Today, Gordonstoun has a rigorous approach to child protection.

“Our policies and procedures are robust and have been developed and approved by leading child protection experts.”

Keir, now living in Calveley, had denied swimming and showering in the nude while in a state of arousal with three pupils, and encouraging them to do the same.

He refuted allegations of “skinny dipping” with pupils claiming he could have taken boys into the pool alone – but only if he had an “evil mind”.

His three victims, now all in their 40s, told how he took them for secret swimming sessions in the dark and chased them naked in the water.

Keir, a black belt in judo, was also convicted of putting his hand on one victim’s crotch and bottom while they “grappled” in a classroom.

He then put his hands down the same pupil’s trousers while he played computer games and performed a sex act on him.

The witnesses said they told the school’s chaplain what had happened but nothing was done.

Giving evidence Keir claimed his diagnosis with Asperger’s syndrome made it impossible for him to come up with a reason why the trio would accuse him.

Keir insisted he was often too busy as a housemaster, teacher, judo and sailing coach and driver of the school fire engine to be alone with pupils.

He said: “It would have been exceptionally unusual for me to have a half hour spare. I would certainly never be alone with a pupil.”

Keir added: “If I had had an evil mind I might have managed it, but I didn’t. It would have been possible, but I didn’t.”

Prosecutor Alison Young described Keir’s pattern of alleged behaviour of getting victims alone outside of class as “basically grooming”.

Keir was convicted of lewd, indecent or libidinous practices between November 1988 and March 1989 by removing his swimming trunks in the presence of children.

He was also found guilty of indecent assault by placing his hands down the trousers of a child and disorderly conduct by removing his swimming trunks in the presence of a child.

In their statement Gordonstoun also praised the whistleblowers and said they now had rigorous measures in place to protect children.

The school said: “We are profoundly saddened by this case. The offences for which Andrew Keir has been convicted are distressing for all involved and we admire the courage of those who came forward to seek justice.

“When we were contacted by the police in 2015 about the allegations we gave them our full co-operation and wrote to our alumni offering our support and urging anyone affected to contact the police.”

Sheriff Olga Pasportnikov will sentence Keir next month (April).