A mother used Facebook to catch a dangerous paedophile after he tried to lure her 11-year-old daughter into his car.
The mum went online to alert other families about the predator, which led to him being arrested – and jailed for 18 months.
Now the mother and her family have been praised by detectives for using social media in such a positive way.
Detective Constable Sheena Maerevoet, of Wigan police, said: "This is a fine example of the community working together to help us take a sex offender off the streets.
"While we always encourage victims and their families to call the police in the first instance, it is heartening to see the family taking a proactive step to warn others.
"The Facebook post, combined with the quick thinking of the bus driver, helped us catch Hughes before he could approach any other children."
The schoolgirl was walking alone on a summer's day along an isolated road in Wigan when a 4x4 vehicle driven by Stacey John Hughes suddenly pulled up in front of her.
It stopped half on and half off the pavement and 36-year-old Hughes started speaking to the girl, who was out looking for a friend's lost cat. He asked the youngster for directions but she could see that he had exposed himself and was performing a sex act.
Harry Pepper, prosecuting, told Liverpool Crown Court that the youngster 'was frozen to the spot' and feared for her safety.
"She was thinking 'if I don't get out of here I will be seriously regretting it. I am really, really, really scared'," he said.
"He leant over to open the passenger door and was saying 'get in' but she walked off. She was so distressed she did not initially go home and walked around crying."
Fortunately, a quick-thinking bus driver saw the incident and took a note of the 4x4's registration number.
Later while looking on Facebook he spotted warnings to children about the incident and he rang the police.
Hughes, a freelance gardener, who has a previous conviction involving harassing his ex-partner with whom he has a young child, pleaded guilty to inciting the girl to engage in sexual activity on August 2 last year.
Jailing him for 18 months Judge Stephen Clarke said that Hughes had been 'cajoling her to get in the car'.
"The offence is very worrying and the court is concerned about your behaviour which involved an element of planning," he told Hughes.
The judge also ordered him to sign the Sex Offenders' Register for 10 years, banned him from working with children and made a Sexual Offences Prevention Order restricting his contact with children for 10 years.