Antonio Sabiu, 57, was found not proven of being concerned in the supply of drugs by a majority verdict after a two-week trial at Inverness Sheriff Court.
But Sabiu was jailed for two years and four months by Sheriff Jamie Gilchrist QC after it emerged that it was the second time he had gone on trial for the offence which took place at Inverness Prison.
He had gone on the run for ten days during the original trial in February.
He was found guilty of failing to appear at the court.
But Detective Inspector Richard Baird, 41, was incriminated by Sabiu. It is unlikely the officer will face either prosecution or another internal enquiry after he strenuously denied the accusation and was cleared by an internal police investigation.
Sabiu, who would have faced a far longer sentence had he been convicted of the more serious charge said to the jury as he was led away in handcuffs: "Thank you. God bless you."