A former Gainsborough man was caught in a sting after grooming what he thought were teenage girls on the internet.
Gary Neville believed he had been messaging a 13-year-old and a 14-year-old on a chatroom.
He then arranged to meet an adult woman at Gainsborough Central railway station and turned up to find himself confronted by members of a group of paedophile hunters.
Almas Ben-Aribia , prosecuting, told Lincoln Crown Court that the group set up decoy accounts using the names Sophie and Alannah which resulted in Neville contacting them on a chatroom.
Miss Ben-Aribia said: "He was told of their ages.
"He informed Sophie of his correct age and said he liked looking at young people. He sent a number of sexually explicit messages to her and requested a photograph back.
"He made it clear that he wished to have sex with her. These were chats which took place over a two week period.
"He sent a number of sexually explicit messages to Alannah. He requested pictures back off her.
"He asked Alannah to take her clothes off and told her he wanted her to have sex with him.
"He invited both of the girls to touch him in a sexual manner.
"The defendant was arrested at Gainsborough Central Station the police having been informed by a number of members of an online child protection group.
"He made admissions in interview. He said he started the chats because he was bored. He said it was just talk and he regretted what he described as a moment of madness."
Neville, 55, currently of no fixed address but originally from Gainsborough, admitted two charges of attempting to engage in sexual communication with a child on dates between June 30 and July 13 this year.
Michael Cranmer-Brown, in mitigation, said that Neville was of previous good character and has shown remorse for what he did.
Mr Cranmer-Brown said: "The impact upon the defendant has been significant. He has been divorced by his wife and he has had to leave his home in Gainsborough.
"He has lost his job because he was remanded in custody, he has lost his wife and he has lost his home town because he is not going to be able to go back there."
Neville was given a two year community order. He was ordered to complete a sex offenders' rehabilitation programme and given a rehabilitation activity requirement of up to 40 days.