A Bradford judge has praised an online vigilante group for their role in bringing a paedophile to justice.

Judge Jonathan Durham Hall QC made the comment as he sentenced Paul Farrell, 31, at Bradford Crown Court earlier this week for trying to arrange sex with an underage girl.

He told Farrell: "These groups are doing, as long as they stay within the law, a great service and they are out there, and the police, watching and waiting for people like you."

The judge's remarks came just days before it emerged that eight men had killed themselves after being 'exposed' by other groups who pose as underage girls online.

The daughter of one of them, 67-year-old Michael Duff, urged paedophile groups to 'understand the wider ramifications of their actions.'

However, Judge Durham Hall, the Recorder of Bradford, complimented the Catching Online Predators (COP) group for helping catch Farrell in a sting when he sentenced him on Monday.

He heard how Farrell, who mounted a roof-top protest after being confronted by the group, planned to meet a 13-year-old 'decoy girl' he had groomed through Facebook.

The account was set up in a fake name by members of COP who pretended to be the underage girl.

The recovering drug user had failed to show up to two planned meetups so members had traced him to an address who was staying at in Halifax, West Yorks.

After confronting him, Farrell clambers on to the roof of the terraced property to escape them.

Footage then captured the pervert exchanging insults with people in the street below before hurling tiles off the roof as police officers urged the group to stop filming.

Police set up a cordon around the scene in June last year and negotiators attended along with ambulance and fire crews.

Farrell, of no fixed abode, admitted two charges of trying to meet an underage girl for sex and causing £1,000 worth of damage to the roof of a house.

He was given an 18-month prison sentence, suspended for two years, at Bradford Crown Court on Monday.

Prosecutor Camille Morland told the court that Farrell had used his own Facebook profile to arrange meetings for sex with a 13-year-old "decoy" monitored by the group.

On two days in June, Farrell arranged to meet the girl outside Calderdale Royal Hospital and Huddersfield railway station but failed to turn up on both occasions.

Miss Morland said members of the group tracked Farrell down to an address where he was staying, but when he realised they were outside he climbed onto the roof.

Mitigating, Gerald Hendron said his client was anxious to work with the probation service to address the underlying issues that gave rise to the convictions.

The judge explained that if he sentenced Farrell to an immediate jail term he could be out of prison in a few weeks because of the time he had already served on remand.

As part of his suspended jail term, Farrell will also have to comply with a 90-day sex offender group work programme.

Judge Durham Hall QC told Farrell: "That's a tough course. It has great results for those who want to change."

"I won't hesitate to lock you up if it doesn't work.”

Farrell was warned by the judge that if he breached the sexual harm prevention order he could face a maximum of five years in jail.

He will have to comply with a sexual harm prevention order and register as a sex offender with the police for the next 10 years.