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 Earlston High School  and the police were 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 while in a position of trust as a teacher 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.

McInally, who has moved back to his native Dundee area with his fiancee who is standing by him and had their second child nine months ago, had sentence deferred until November 9 for background reports and his name placed on the Sex Offender's Register.

Procurator fiscal Graham Fraser told the court that the girl had difficulties with Higher Modern Studies and he had assisted her during a free period.

He said they had got on well and as well as speaking in school communicated on Twitter.

Mr Fraser said that just before the Christmas holidays he gave her a Christmas card which contained his e-mail address in case she needed help and two quotations from The Great Gatsby which was one of her favourite books - one of which had "connotations."

He explained: "She contacted him by the email provided. He suggested that they should meet and she was happy to go along with this.

"On Sunday 22 December they drove into the countryside in Galashiels and stopped at a viewpoint wooded area where they kissed on this occasion.

"They were joking how awkward it was going to be and he repeatedly said what am I doing but said that he liked her."

Mr Fraser said 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.

He said:"This became clear from the e-mail exchange clear from the e-mail exchange in the ensuing hours where she said he talked in his sleep. There was no indication sex had taken place.

"This repeated itself when the partner was out with had shift work and she came round to the accused house and spent time with him."

Mr Fraser said this appeared to have been known to other pupils at Earlston High School and rumours started to circulate especially when she was spotted being driven home in his car.

McInally was spoken to by senior school staff and said he had run her home as she was not feeling well and was in distress and any other teacher would have done the same.

But the school contacted the police and the girl admitted she had had a sexual relationship with the accused which involved full intercourse and this was supported by a medical examination.

Mr Fraser said there was no suggestion the girl was unwilling to enter into the relationship.

But he added for McInally's involvement with her to go as far as it did was "wholly unprofessional and inappropriate."

He said: "In her words, if they had not got caught she hoped it would have continued."

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.