A Modern Studies teacher who had intercourse with a female pupil has been placed on the Sex Offender's Register.
Ryan McInally, 30, admitted having sex with the 16-year-old girl at his home while his partner worked nightshift.
But he was caught out after rumours of their relationship swept the school in the Borders and the police were then contacted by the school.
The girl admitted to officers they had a sexual relationship and had full intercourse.
Selkirk Sheriff Court was told that the girl was given a medical examination and DNA samples were linked to McInally.
He pleaded guilty on indictment to a charge of having sexual intercourse with the girl, who was a pupil, at a house in St Boswells on an occasion between December 22, 2013, and January 16, 2014, while in a position of trust as a teacher.
McInally had his sentence deferred until November 9 for background reports, and his name has been placed on the Sex Offender's Register.
McInally, of Monikie in Angus, moved to the Borders with his fiancee in Autumn 2013 to take up the post at Earlston High School.
Defence lawyer Robert More said he was suspended from the school when the inquiry was launched and he had since returned to the Dundee area with his fiancee.
Sheriff Peter Paterson said the length of time McInally's name would be on the Sex Offender's Register would be fixed when he was sentenced in six weeks time.