Eighteen-year-old Patrick Joseph Baker was spotted by the officer who had been called to a disturbance on School Road, Donnington, in the small hours of August 29, said prosecutor Mrs Abigail Hall.
"He observed a male who appeared to be hiding behind the wheelie bin in a garden," she said.
When approached by the officer, Baker was seen to drop a small plastic packet into a hedge, said the prosecutor.
The defendant was arrested and the contents of the plastic bag was examined and found to be a small amount of cocaine. Baker, of Brands Farm Way, Telford, pleaded guilty to possessing a class A drug yesterday when he appeared before Telford Magistrates Court.
Magistrates heard that the 0.4g of cocaine had a value of £20 and that Baker had no previous convictions for drug matters.
Baker, who was not represented, said that he was not a regular drug user and had bought the cocaine as "a one-off" from a man he met in a pub in Wellington.
Baker, a full-time steel fixer, was fined £280 and ordered to pay a total of £293 in court costs. Magistrate Nigel Atkinson said: "This little packet has cost you dearly" and added: "This was one expensive high that you didn't have."