A Tranent man has escaped a jail sentence after he admitted sending sexual messages to who he believed was a young girl.

Andrew Grant, of Coalgate Avenue, sent written sexual communication to a ‘girl’ called Lucy after making contact over social media.

Grant, 33, also sent the ‘girl’ a sexually explicit video and attempted to get the ‘girl’ to view the images.

But the ‘girl’ turned out to be a decoy used by a paedophile hunter group which operates online.

He pleaded guilty to the two offences at Edinburgh Sheriff Court on March 20 and he was remanded in custody, pending sentencing.

He returned to court from custody this week where he was handed a stringent community payback order as an alternative to a custodial sentence.

Sheriff Peter McCormack placed Grant on the sex offenders’ register for five years and ordered him to carry out 160 hours of unpaid work in the community.

Grant was also given a two-year supervision order as well as a conduct requirement that contains various elements regarding his use of the internet. Grant admitted sending written sexual communications and sending a sexually explicit video to a child at Thistle Street, Edinburgh, on February 19 and 20 this year.