A student who was snared in a sting by paedophile hunters has thanked the group for stopping him from committing an offence on a child.
Alexander Stafford thought he had been chatting to a 15-year-old boy over dating site Grindr but had been duped by Guardians of the North, who had set up the fake profile.
Newcastle Crown Court heard within three hours of the conversation starting, the 22-year-old, who was studying at Sunderland University, had arranged to meet the youth for sexual activity.
But when Stafford turned up at his local Tesco to meet the boy, he was confronted by Guardians of the North, who had alerted the police.
Stafford, of Portobello Lane, Sunderland, was arrested and confessed to police he "wasn't sure" if he posed a risk to real children.
Prosecutor Paul Cleasby told the court: "He went on to offer thanks to Guardians of the North for preventing him from committing a serious sexual offence."
Stafford, who had had already sought professional help to address his problems, pleaded guilty to attempting to meet a child following sexual grooming.
The court heard Stafford had started chatting with who he thought was "Richard", who he was told was 15, on a Sunday morning last September.
Mr Cleasby added: "The meeting was arranged for within three hours of the initial contact.
"The attempt to commit a sexual offence was within three hours of the first conversation with someone he believed to be a child."
The court heard Stafford, who has never been in trouble before, is now due to go back to Cyprus, where he lives with his mum.
Judge Amanda Rippon deferred sentence for five months, to give Stafford a chance to find a psychiatrist who could set up a treatment plan abroad, as part of a sentence imposed in the Uk.
Judge Rippon said Stafford must sign the sex offenders register before he leaves the country.
The judge added: "I am doing the best I can for the wider public in the first instance, to try to ensure the risk that you pose is diminished."
Judge Rippon told Stafford: "I think the risk you pose will be managed better if you can go home and into the support of your family.
"But please understand, I will not hesitate to lock you up, if I think that is the only course available to me."
Andrew Walker, defending, said Stafford will abide by any order imposed by the court and will co-operate with the authorities.