A drunken workman tried to abduct a four-year-old boy in a supermarket car park.
Andrzej Palosz took the child by the hand and attempted to lead him away from his mother in the nightmare incident.
The worried mum grabbed her son back and put him in the front passenger seat of her car.
But Palosz followed her and seized hold of the youngster’s arms and tried to pull him out of the vehicle, Livingston Sheriff Court was told.
Bizarrely, he did not object when the furious mum filmed him on her mobile phone.
She later publicised the incident on social media in a bid to identify the accused.
The creep was dressed in dirty work clothes, had a cigarette hanging out of his mouth and appeared to be under the influence of alcohol or drugs.
The video footage was eventually passed to police who traced Palosz and charged him with the serious crime.
Palosz, 48, appeared on petition shortly afterwards and was remanded in custody pending resolution of a plea.
The accused, who is currently an inmate at HMP Addiewell, West Lothian, pleaded guilty on Wednesday to approaching the boy and attempting to abduct him.
The plea, by way of a Section 76 indictment, was agreed in advance following discussions between his lawyer Lindsey Cunningham and the Crown Office.
He admitted committing the offence in an Aldi supermarket car park at the junction of Menzies Road and Gardners Lane, in Bathgate, West Lothian, on May 7 this year.
Depute fiscal Neil Martin, prosecuting, formally moved for sentence and informed the court that Palosz had no previous convictions.
Miss Cunningham said she was making no application for bail in the meantime.
Sheriff Martin Edington told Palosz through an interpreter that, given the nature of his conviction, background reports would be required before sentencing.
He called for community payback order reports to include recommendations for supervision and unpaid hours of work.
He also ordered an assessment of the accused’s suitability for electronic monitoring under a restriction of liberty order.
The sheriff adjourned the case until 12 December and told Palosz he would remain in custody until then.
Don’t miss the latest news from around Scotland and beyond. Sign up to our daily newsletter.