Darren Barnwell (20) was handed a four year suspended prison sentence for what a judge described as "an unusual crime."
Mr Barnwell of Blackhall Parade, Dublin pleaded guilty before Judge Sean O'Donnabháin at Cork Circuit Criminal Court to possession of cocaine for sale or supply on August 16 2018.
The court was told he panicked when on a train at Kent Station and suddenly realised his bag was missing.
He disembarked from the train - and was not allowed to reboard it to look for the bag.
Detective Sergeant Kieran O’Sullivan said Mr Barnwell got incensed with security staff at Kent Station around 2pm on August 16 in relation to the lost bag.
Gardaí later received a phone call in respect of a missing bag - with the call believed to have been received from Mr Barnwell.
The defendant then remembered he had gone into a shop on nearby MacCurtain Street.
Mr Barnwell returned to the shop and was reunited with his bag which had been discovered minutes earlier by staff.
They had not inspected the contents of the paper bag involved.
Det Sgt O’Sullivan said that Gardaí - alerted to the missing bag by the phone call - stopped Mr Barnwell on the street outside the shop.
They became suspicious given the defendant's panicked state and insisted on examining the bag involved.
When they opened the paper bag they discovered a large quantity of cocaine which, on analysis, was found to have a street value of €40,000.
Mr Barnwell admitted he had made the journey on the train from Dublin bringing the cocaine with him.
Judge O'Donnabháin was told the defendant had no previous criminal convictions.
On the date of the offence he was working as a courier who was to deliver the cocaine to another individual.
Sgt O’Sullivan said in the intervening period since the incident, Mr Barnwell had not come to the attention of Gardaí.
Judge O’Donnabhain said it was “an unusual crime.”
“I am justified in imposing a fully suspended sentence. It is exceptional that he has no previous convictions or come to garda attention since,” he said.
He imposed a sentence of four years which he suspended in its entirety on condition that Mr Barnwell keeps the peace and is of good behaviour for a period of four years.