A court has heard how a woman ended up in hospital in Dumfries after buying heroin from a dealer who was unaware it was contaminated with anthrax.
Sheriff Kenneth Ross said he accepted Darren Scott, 24, had not known the drug was infected.
Scott admitted supplying heroin at the Lochside and Lincluden housing estates in Dumfries between September last year and the end of March.
He was jailed at the town's sheriff court for a total of four years.
Depute fiscal Pamela Rhodes said Scott's dealing came to light during a police operation following a number of anthrax cases among heroin users.
The court heard the total value of drugs passing through his hands had a street value of up to £20,000.
Solicitor Liz Dougan said that Scott, described as a prisoner in Dumfries, had developed a cocaine habit and had agreed to become involved with the heroin to write off a debt of about £1,000.