A soldier sent messages to an underage boy on a gay and bi-sexual chat site before meeting for sex.
Alexander Gemmell, 29, of Beechgrove Place, Perth, who is based at Leuchars in Fife, started communicating with the boy on the Fab Guys gay and bi-sexual website.
The offence only came to light when the youngster’s mother found he had taken an illegal drug and was told the soldier had given it to him.
Depute Fiscal Carol Whyte told Perth Sheriff Court: “The accused describes himself as a homosexual and sent correspondence to the boy on a chat site called Fab Guys.
“The boy’s mother questioned where he had got an illegal drug from and he said it was from a man he had been meeting for sex.
“The mother phoned the police and officers took away the boy’s phone and computer and was told his passwords for these.”
Police had investigated the case as part of the national Operation Barlee clampdown.
Ms Whyte said the boy had told his mother he had joined the website to meet men for sex.
She added: “He told the accused his true age but the pair met on a derelict site in Perth, with Gemmell arriving in a black Range Rover.
“The pair talked and then took their clothes off and took part in sex acts before Gemmell attempted anal sex with the boy.”
The court heard that detectives arrived at Leuchars Army base on February 5 when they interviewed Gemmell.
Gemmell admitted that between August 24 last year and January 24 this year, at his home address, he intentionally sent a sexual communication to a boy under the age of 16, corresponded with him on a gay and bi-sexual website for the purpose of obtaining sexual gratification and with a view to meeting him to engage in sex.
He also admitted that he engaged in sexual activity with the boy on derelict land in Perth.
Sentence was deferred until October 12 for background reports and Gemmell is to be placed on the sex offenders’ register.