Police seized a large amount of powder during a raid on a property in Church Square in Galashiels as part of a crackdown on drug dealing last September but it was later found not to be illegal.
Daniel McKenzie, 22, was originally with being concerned in the supply of heroin, along with an 18-year-old woman, but Selkirk Sheriff Court was told that analysis of the powder revealed it not to be a controlled drug.
A gramme of heroin was found, though, and McKenzie pleaded guilty to possession of a quantity of the class-A drug to the value of £10.
Defence lawyer Stephanie Clinkscale said her client had been smoking diamorphine at the time but is now off it.
McKenzie, of Allars Bank in Hawick, was fined £150.
His co-accused, Abbie Brown, had her not-guilty plea accepted by the crown.