A 27-year-old Rosyth man sent sexual messages to someone he believed to be a 12-year-old schoolgirl.

James Waite was in fact contacting a ‘decoy’ and he was snared and confronted by a paedophile-hunter group.

He contacted the ‘girl’ over a two-month period, asked to send him intimate images of herself, sent her a video of himself masturbating.

Waite, of Dundonald Road, appeared for sentencing at Dunfermline Sheriff Court.

He admitted that between February 14 and April 10 last year he attempted to cause a person he believed to be a child, a 'girl' called Kaylee aged 12, who was in fact an adult pretending to be a child, to look at a sexual image.

He sent online messages of a sexually explicit nature, pictures of his genitals and a video of him masturbating, asked her to send him intimate images and thereby attempted to communicate indecently with a child.

Procurator fiscal depute Laura McManus previously told the court the adult decoy, a 37-year-old woman, accepted a Facebook friend request from Waite.

The decoy clearly stated her age as 12 years old “within the first five messages” and Waite acknowledged he was “too old for her” and they “can be friends”.

However, on multiple occasions Waite requested naked pictures and asked her to “keep it a secret”.

The chat turned more explicit on Waite’s side and he sent an intimate picture and a video of himself in a sex act.

A meeting was set up at a bus stop in Rosyth and Waite was confronted by the paedo-hunters and it was streamed live on Facebook.

The court heard there were over 500 pages of correspondence between Waite and the girl.

The messages included him saying he would like to have sex with her and others going into more explicit detail.

Defence solicitor Alexander Flett said his client has “learning difficulties” and has been suspended from his work as a result of the offence.

He went on: “He’s accepted that he’s done wrong. His family are very distressed but remain supportive. He would be very vulnerable in a custodial setting.”

Sheriff Charles Macnair told Waite he had come very close to being sent to jail.

He said: “You thought that you were communicating with a 12-year-old girl and you sent her sexual messages including videos of you masturbating.

“The fact that this was not a real girl makes very little difference to your offending.”

The sheriff imposed a community payback order with 300 hours of unpaid work and three years of supervision.