A supply teacher who sexually assaulted two boys on the day he arrived in a Fife school has been placed under supervision for three years.
Stephen Tait, who denied the offences, touched the six- and seven-year-old boys in his P3 class inappropriately as he was marking their work.
The 29-year-old was also given 250 hours of community service.
At Dunfermline Sheriff Court, Sheriff Colin McClory said Mr Tait had avoided jail only because it would allow him to be placed under supervision.
Mr Tait was also put on the sex offenders' register for three years, and banned from leaving his house between 19:00 and 07:00 for nine months.
Sheriff McClory said there had been a "grotesque breach of trust" on the part of Mr Tait, who was sentenced after a trial in June. He said the only way the court could keep the public safe from him was not to send him to jail.
The mother of one of the boys left the courtroom in tears as the sentence was read out, branding it "a joke".
Sheriff McClory, who described the boys as "compelling witnesses", told Mr Tait: "You won't work in a school again. You sexually interfered with these young boys and it is a grotesque breach of trust."
The sheriff said that, within a few months of a prison sentence, Mr Tait would be out and "essentially be unsupervised in the community".
"I can't allow that to happen," he said. "For public safety, the court needs to be able to keep track of him."