Terry Robertson, 44, of Cunningham Terrace, Aberdeen, admitted possessing heroin in his car as he drove through Dundee.
Robertson was stopped by police acting on a tip-off at Forfar Road on August 6, and told them he had the drug in his sock.
Depute fiscal Joanne Smith told the court a bag containing 1.35 grammes of diamorphine was found, with a street value of £135.
She added that Robertson had a very serious previous High Court conviction for drugs offences.
Solicitor Mike Monro said Robertson was now keeping out of trouble and only used drugs “now and then.”
Sentence was deferred until December 21.