A hospital had to be partially evacuated when a teenager caused a bomb scare by leaving a package containing illegal drugs inside a disabled toilet.
Major disruption was caused at Chapel Allerton Hospital, in Leeds, after a member of staff found it and alerted security.
Armed police and army bomb disposal experts were called.
Patients had to be evacuated from some wards.
Leeds Crown Court heard the package was taped to the back of the toilet door and had wires coming from it.
It was found to contain 135 anabolic steroid tablets and two mobile phones.
Joe Culley, prosecuting, said the package had been placed there by Samuel Hall, on June 8 last year.
Mr Culley told the court Hall had been instructed to put it there by a drug dealer in exchange for £100.
Hall caught a taxi to a police station and handed himself in later that day after seeing media reports of the bomb scare.
He told officers he had watched the package being wrapped up before taking it the hospital
Hall said he did not know who it was intended for but thought the visible appearance of the package looked “dodgy”.
The package was discovered just before 3pm and the hospital was declared safe at 5.20pm.
Buses had to be used to transport patients from the hospital to a leisure centre
Hall, of Coates Street, Bradford, pleaded guilty to possession of a class C drug with intent to supply.
Lorraine Harris, mitigating, said: “At first blush this appears sinister but this is not the case at all.
“It was always his intention that he was going to drop off a drugs package.
“He had no intention of the consequences of his actions.
“He said he was told categorically to fix the package in a certain place in the toilet.
“He tried to use some implement to make it fit and now realises it made it look more sinister.”
Miss Harris described Hall, now aged 20, as someone who could easily be manipulated.
She said he agreed to deliver the package as he was about to become a father and needed money.
She added: “As soon as he became aware via social media that the police had found a package at the hospital, he got a taxi and handed himself in.
“While the criminality cannot be ignored, it is submitted that his actions in going to help resolve the issue should be held to his credit.”
Hall was given a four-month prison sentence, suspended for two years.
He was ordered to take part in a 30-day programme designed to address his offending.
Recorder Mark McKone said: “You must realise how close you have come to an immediate custodial sentence for the incredibly reckless thing you did.
“This is your very last chance.”