Police uncovered a cannabis farm next door to their own station.
Officers carried out a raid after being alerted by the pungent smell coming from the Wishaw warehouse and discovered 118 plants worth £70,000.
Hamilton Sheriff Court heard that Paul MCann fainted when he was detained by cops after being caught red-handed with the keys, the Daily Record reports.
READ MORE: Glasgow cop seriously injured after officers called to Drumchapel 'rammy'
The dad-of-two from Blantyre pled guilty to producing cannabis and bing concerned in its supply.
Prosecutor Abby Seal explained: "Police officers detected a strong smell of cannabis and detained him. As they walked towards the premises, the accused became extremely nervous and fainted.
"Officers opened the door and could smell cannabis and hear fans running. During a search 118 cannabis plants were found as well as 99 cannabis seedlings. The accused's phone was examined and revealed conversations involving equipment for the premises.
"There would have been a substantial financial outlay to obtain items such as duct tape, fans, bags of pebbles and cooling tubes. The estimated cost of the equipment found is £23,000. Specialist officers say it was commercial-level production of cannabis."
McCann, 41, was jailed for 21 months following the raid on June 18, 2020.
He claimed that when he started work at the building next door to Wishaw police station he didn't realise what was being set up.
His lawyer, Ali Murray, said: "Work dried up during the pandemic and he ended up doing odd jobs including at what he thought was a warehouse. By the time he realised what was involved he felt it was too late to pull out, not for his personal safety but that of his family.
"He is remorseful and realises the impact this kind of behaviour has on communities."
Sheriff Andrew McIntyre said: "This was an extensive commercial operation. You were central to it, obtaining valuable equipment that was essential to the operation."
READ NEXT:
- Body of man recovered from River Clyde near Glasgow
- Glasgow police probing west end robbery make CCTV appeal
- Body of man recovered from River Clyde near Glasgow
- Man, 24, murdered on Lanark street as police launch investigation
- Woman sexually assaulted near Paisley park as police hunt for suspect