When he was told his car was to be searched for drugs a 32-year-old man immediately handed over cocaine and cannabis to police.
Thomas Anthony Patrick Smith, Ballyoran Park, Portadown, admitted unlawful possession of cocaine on June 8 this year and unlawful possession of cannabis.
For each offence he was sentenced to two months in prison, suspended for two years.
The court heard that police stopped a car owned and driven by the defendant on the M1 and said a search was going to be carried out under warrant for drugs.
Smith immediately handed over two small bags of cannabis and also a bag of cocaine. A silver pipe was also found. Smith said he knew it was illegal for him to have the drugs in his possession. He had a record.
Sentencing in the case was adjourned from a previous court so that a pre-sentence report could be obtained.
A barrister representing the defendant said he volunteered the drugs immediately and had been candid with probation about his cannabis use.
She added that he had significant mental health issues so probation was not an option but he was willing to do community service.
District Judge, Mrs Bernie Kelly, said that possession of cocaine was a very serious matter. She added that Smith had a poor record of drug misuse and the report indicated he was a fairly regular drug user.
The judge said she was not minded to consider community service and probation had been ruled out. She ruled the matter so serious that only one sentence could be imposed but said the defendant was entitled to credit for pleading guilty at the first opportunity.