A 31-year-old Newtown St Boswells man was caught out by a vigilante group telling a girl he thought was aged 13 that he wanted to have sex with her.

Neil Murray admitted sending messages of a sexual and indecent nature to the girl called "Beccy", including a picture of his manhood.

But Selkirk Sheriff Court was told that the communications were to a group who target sexual predators by setting up fake profiles on social media platforms.

He pleaded guilty to the offence that happened from a house in Glenburn Avenue, Newtown St Boswells, between April and May last year.

Sentence has been deferred until next month for the production of background reports and Murray's name placed on the Sex Offenders Register.

Procurator fiscal Graham Fraser described how the fake profile was set up in the name of a decoy called "Beccy" who posed as a 13-year-old girl, and included a profile photo consistent with someone that age.

He explained: "The accused got in touch with her by "waving" at this girl Beccy with a Facebook request."

Mr Fraser said initially the messages were harmless asking how she was today which she replied she was good.

He said that she asked how old he was and he replied 30 while she said she was 13.

They continued to exchange messages through Facebook messenger with Murray saying he worked as a janitor at a local school and he gave her his mobile number and asked "Beccy" to send him her number.

The fiscal said that on April 13 last year Murray made contact through Whatsapp saying it was Neil from Facebook.

A conversation took place between the pair during which he said that if she was ever in Hawick he would come and see her saying that he was single and asking if she was single?

Mr Fraser said Murray was saying things like he wanted to join her in the bath and would wash her back and told her several times that he loved her.

He asked her if she would like a serious boyfriend and she reminded him she was 13.

The court was told Murray would then say what they would do when they met and that he wanted to have sex with her and for him to show her how to have sex.

Murray is then said to have made a "possible arrangement" to meet with her referring to it as a date and "to go somewhere private to have sex".

The court heard how Murray then offered to send her a picture of his penis and asked her to send a photo in return.

Mr Fraser said: "He told her he would make her feel like an adult when she had sex."

Murray then followed this up with the question on whether Becky wanted to see his penis to which the decoy replied "it was up to him".

Mr Fraser said there were six messages about having sexual relations from Murray and a similar number from the decoy saying that she was only 13 years old.

Murray did send her some photographs which were not offensive including his car, workplace and the outside of his house.

The matter was eventually came to the attention of the police and Murray told officers, 'I am guilty of doing it'.

The court heard he gave a "comprehensive explanation" of what had happened and an examination of his phone confirmed the information would be available.

Murray of Roxburgh Place, pleaded guilty to a charge of attempting to send a sexual communication to a girl aged 13 in that he did send messages of a sexual and indecent nature.

A not guilty plea to three other charges including arranging to meet up with Beccy and another under age girl called Kayla for the purpose of engaging in unlawful sexual activity were accepted by the Crown.

Sentence was deferred until June 3 for the production of a Criminal Justice Social Work Report and a Restriction of Liberty Order assessment.

Murray's name was also placed on the Sex Offenders Register - the period of time will be determined when he is sentenced.