A former soldier who grew cannabis with a potential street value of £115,000 for "medicinal purposes" has been jailed for three years.
Mark Landale, 45, from Cockermouth in Cumbria said he had resorted to the drug to treat an illness contracted during a spell in South America.
However, a court heard a police raid on a cottage he rented at Westerhall near Langholm found more than 100 plants.
Landale admitted producing the drug and was found guilty of supplying it.
The court heard he had developed an illness with long-term consequences including chronic fatigue and constant headaches.
Sheriff Kenneth Ross was told that Landale had seen a large number of doctors before resorting to cannabis.
He had rented the premises near Langholm looking for a rural life.
The court heard that a raid on the cottage in Dumfries and Galloway discovered what police described as a "sophisticated operation" for producing the drug.
Landale's solicitor told the court that his client was no longer using cannabis and realised he had made a grave mistake.
He admitted producing the drug during a six-month period to February last year and was found guilty of being concerned in the supply of cannabis during the same period.
The sheriff pointed out that the High Court had made it clear that imprisonment was appropriate in cases involving supply and there was a maximum penalty of 14 years.
He said he was satisfied there were mitigating circumstances in this case, but taking into account the quantity and value he felt that only a prison sentence was appropriate.