A modern studies teacher from Angus who had sex with a female pupil has been ordered to carry out 200 hours of unpaid work.
Ryan McInally, 30, of Monikie, previously admitted having intercourse with the 16-year-old girl at his home while his partner worked night shift.
But he was caught out after rumours of their relationship swept the school in the Borders and the police were contacted by the school.
He had pleaded guilty on indictment to a charge of while in a position of trust as a teacher having sexual intercourse with the girl who was a pupil at a house in the Borders on an occasion between December 22 2013 and January 16 2014.
McInally, who has moved back to the Dundee area with his fiancee who is standing by him, has also been placed on the sex offenders register for a period of three years.
He was supported in court by his fiancee, who is the mother of his two children.
Defence lawyer Robert More told Selkirk Sheriff Court: “His partner deserves enormous credit for the way she has stuck with him in difficult circumstances.
“The offence was admitted to her shortly after he was arrested. They have rebuilt their relationship.”
He added: “He is a man of high intelligence but was extremely foolish on this particular occasion.”
McInally and the girl met up and kissed in the countryside just before Christmas.
They continued to meet up during the holidays and on New Year’s Eve he took her back to his home where she stayed overnight.
This appeared to have been known to other pupils at the school and rumours started to circulate especially when she was spotted being driven home in his car.
He was spoken to by senior staff and said he had run her home as she was not feeling well and any other teacher would have done the same.
But the school contacted police and the girl admitted she had a sexual relationship with McInally which involved full intercourse.