The deputy chairman of the southern Khatlon regional court, Jamolkhon Saidov, says the 17 Afghans were part of a group that also trafficked narcotics. He says an investigation into those activities is still under way.
Saidov says the group operated in Tajikistan from 1996 to 2005. The prison terms handed down to the 17 ranged from 2.5 to 25 years.
Tajikistan is a first stage on drug-smuggling routes out of Afghanistan.
Border guards apprehend drug smugglers along the Tajik-Afghan border every week, and shoot-outs with smugglers are common.
Afghan drug smugglers have also taken Tajik citizens hostage and forced their relatives to traffic narcotics to obtain their freedom.