Kenneth Dixon was visiting his brother-in-law at a prison in Sheffield when he was informed he would be searched.
He immediately told the officer he was carrying drugs, the Shields Gazette reports.
Dixon, of South Shields, pleaded guilty to one count of conveying a concealed Class C drug.
Prosecutor Neil Pallister told the court on Tuesday: “Two tablets were recovered from the defendant’s penis, and he made full admissions to the police.”
A clerk for Newcastle Crown Court confirmed to Huffington Post UK that Dixon was sentenced to three months in prison, suspended for 12 months.
He was also given 150 hours of unpaid work.
It’s not clear exactly how Dixon concealed the drugs, but it does bring to mind a case from 2011 in Kentucky.
Antoine Banks was being patted down by officers following an arrest when they found a small bag of suspected cocaine tied to the waistband of his underwear.