A suspended gang and weapons enforcement detective with Hamilton police has been found guilty of three charges from a 2012 incident where a gun was planted in a suspect's home.

Det. Const. Robert Hansen was found guilty of perjury and two counts of obstruction of justice, court ruled Friday. Hansen was involved with a confidential informant in May of 2012 and encouraged the informant – referred to as "Source C" in the court proceedings – to plant a gun in a suspected drug dealer's house.

"He could use some jail time. Any idea of how to get him? - Text message from Const . Robert Hansen to the informant who planted a gun in the home of a suspected drug dealer.

In follow-up paperwork, Hansen "made a significant material omission" by not stating that the informant had planted the gun in the Highridge Avenue home, said Superior Court Justice Catrina Braid. Hansen's report, instead, said Source C had discovered the gun when the informant had stopped by the home.

Hansen, a 12-year veteran of the police force, has been suspended with pay since June 2012. More charges for Hansen are pending, according to a release from Hamilton police. Both he and Det. Const. Craig Ruthowksky of the gangs and weapons enforcement were charged at that time for different offences.

The Hamilton Spectator reported in November that Ruthowsky was there the day of the search and said Hansen told him there could be a gun in the house and said that information came from an informant.

The case hinged on a series of text messages between Hansen and Source C prior to finding the weapon in the home. Braid read aloud the exchanges prior to her ruling.

"He could use some jail time. Any idea of how to get him?" read one message from Hansen to Source C. When Source C responded with suggestions, Hansen replied "Better I don't know the details then."

Hansen "encouraged the plant," said Braid, with text messages like "If we don't find anything, we can't lock (the suspect) up."

And once the gun had been planted in the home, Hansen received a text from Source C saying that the "heat (was) in the basement, in the couch," read Braid.

Hansen's defence team argued that he was operating under the impression that Source C was just "setting up" the suspect rather than planting evidence on him, said Braid.

"In my view, Hansen's version of events makes no sense," said Braid. "I do not believe Hansen's evidence,"

Hansen had argued that he was unaware that the gun had been planted in the house, but Braid said he would have had to know the gun was planted in the house based on the language in his text messages.

Hansen also argued that he was protecting the identity of Source C when he failed to mention their arrangement in the information to obtain a warrant (ITO) and follow-up paperwork.

Hansen declined to comment on the verdict. A sentencing hearing is scheduled for May 19.