John Boughton drove from his home in Leeds to Newcastle believing he was going to meet a 13-year-old girl.
A court heard that Boughton was instead met by two men who had set up an fake internet profile in which they pretended to be a young girl.
Leeds Crown Court was told the two men were from an online vigilante group called Dark Justice.
They set up the fake profile and were contacted by 38-year-old Boughton in a chatroom which was supposed to be for people aged 13 to 19.
Boughton signed into the chatroom with the username ‘ukperv’ and started a conversation with the ‘victim.’
The court heard the fake profile included images of a girl who was clearly a child.
Boughton discussed having sex and sent indecent images of himself before arranging a meeting.
Boughton, of Redhall Chase, Whinmoor, drove to Newcastle in October last year where he was confronted by the two men at the meeting point they had arranged.
Boughton ran to his car and drove off but the vehicle was stopped after police were contacted with the registration number. Officers searched Boughton and he had condoms in his pocket.
Boughton pleaded guilty to attempting to meet a child following sexual grooming.
Ian Cook, mitigating, said Boughton committed the offence after his marriage had ended and he had become socially isolated. Boughton was jailed for 16 months.
Judge Tom Bayliss, QC, said: “I am quite sure you were intending to have sex with a child.
“This is a case where there has to be an immediate prison sentence to bring it home to you and others who might behave in this manner that it will not be tolerated.”