A judge commended the bravery of two undercover police officers after jailing a professional criminal for 14 years.

The officers were said to have convinced Bradford drug dealer John Waters, of Far Highfield Close, Idle,and his accomplice Adam Ashton, of Mirfield, that they were drug addicts who could be ripped off over a £3,500 cocaine deal.

The officers, part of an anti-drugs campaign known as Operation Greystoke, arranged to meet the duo for a handover in the Grimescar Road area of Huddersfield in February this year.

A jury at Bradford Crown Court heard during a trial how 40-year-old Waters and Ashton, 28, turned up in a Range Rover. After the deal had taken place their vehicle was stopped by armed officers on Huddersfield Road heading towards Mirfield.

Ashton, who is yet to be sentenced for his role, tried to run off. But he was knocked to the ground by an off-duty police officer. When he was searched he was found to have a loaded 9mm semi-automatic handgun in his pocket.

The substance handed over to the undercover officers turned out to be a mixture of the cutting agents lignocaine and caffeine. Judge Jonathan Durham Hall QC said he was satisfied that the duo had taken the gun with them in case the ruse was uncovered.

Yesterday Waters was found guilty of possessing a prohibited weapon, possession of ammunition without a firearms certificate, offering to supply controlled drugs and possessing criminal property.

It emerged that in 1997 he was given a five-year jail term for conspiracy to supply cocaine and heroin. In 2005 he was jailed again for six years for wounding with intent to do grievous bodily harm. He was only released from that sentence in February 2009.

“It is clear to me and I suspect any mature observer that you are a professional criminal,’’ the judge told Waters.

“Such was the skill of the undercover officers that they clearly and totally beguiled you and Ashton, and you thought you were dealing with a couple of smackheads – people of no consequence who could be treated with contempt and conned.’’ After jailing Waters for 14 years, Judge Durham Hall QC said he wanted to commend the courageous officers in the highest terms. “A commendation from me through their Chief Constable will be some small token of the court’s appreciation,’’ he said.