Luke Doyley, 30, had thought he was meeting a young teen boy after exchanging sexual chat on gay dating app Grindr.
But unbeknown to Doyley, he had in fact been speaking to members of the undercover organisation Guardians of the North.
Armed with a camera, the group were waiting for him instead of the boy at the agreed meeting place in Sunderland.
When confronted Doyley asked them: "Is it because I am coloured?"
UPDATE: Part of Wessington Way remains closed and repairs underway after burst pipe causes travel chaos
Fundraiser to be held in memory of Sunderland businessman who died following 'freak accident'
'Like a steam roller' - watch workers describe 'scary' scenes as reports of ground tremors and houses shaking lead to evacuations
Dad of Sunderland AFC fan who took his own life appeals for donations of football equipment as he prepares to launch charity in son's name
Firefighters ramp down operation after large allotment fire in Easington Lane
One member can be heard replying: "No, it is not."
After a conversation in which Doyley, of Beechwood Way, Aston Clinton, Aylesbury, denied the offences, he was arrested by police, who Guardians had contacted in advance.
Prosecuting, Rachel Masters told Newcastle Crown Doyley had first used a fake profile to talk to "Thomas", who made it clear he was between 15, on November 26 2017.
Ms Masters said the message read: "Hey babe, how are you?"
"Thomas" replied saying "I'm good thank you" and made it clear he was under 16.
Ms Masters then told the court that the conversation took a sexual turn and that the next day Doyley sent "Thomas" an explicit picture of himself.
The court heard that the two arranged to meet in Sunderland on November 30.
At this point, Guardians of the North contacted the police.
Officers confronted Doyley on November 30, 2017, at the arranged location in Sunderland and arrested him.
The court heard that Doyley initially denied knowing "Thomas" was under 16 and said his profile showed his age as 23-years-old.
Doyley went onto say that he wanted to report "Thomas" for using the app underage.
Doyley pleaded guilty to the charge of attempting to meet a child after grooming following a hearing at Newcastle Crown Court on January 7 this year.
Defending, Andrew Finlay said: "He accepts his offending.
"He's ashamed of what he has done.
"He's facing up to it now."
Mr Finlay said that in 2017 Doyley was "experiencing significant difficulties" in his life after he split from his partner with whom he has a child.
He then moved to Sunderland to live with his grandfather before his grandfather passed away.
Recorder Andrew Haslam said Doyley "led a law abiding life before 2017" but set out the facts of the case and pointed out that he initially denied the allegations.
Recorder Haslam sentenced Doyley to two years' imprisonment and imposed a Sexual Harm Prevention Order to run for 10 years.
The order made exception to contact with Doyley's own children.