A court has heard how a police inquiry at a house in Gretna led to the discovery of a small cannabis farm with 329 plants worth up to £130,000.
The plants were found in a wardrobe, built-in cupboards and loft areas of the house at Loanwath Road.
Scott Marshall, 50, admitted producing cannabis at his home in June last year and also being concerned in the supplying of the drug.
Sentence was deferred for a month for background reports.
Dumfries Sheriff Court was told that two police officers had gone to the house regarding an inquiry into a previous incident and when Marshall opened the door there was a strong smell of cannabis.
He rejected a request to allow them in to make a search and one officer remained there while the other went to obtain a search warrant.
When he returned the search uncovered the plants of different strains.
The officers also found papers for two bank accounts containing more than £23,000 relating to Marshall and another man.