A spokesman said that the incident happened when about 10 people were spotted by guards crossing the border river of Pyandzh.
He said that the gang opened fire when ordered to stop.
Four traffickers were killed in the gun battle and the rest escaped back into Afghanistan, leaving behind packages containing 215 kilograms of heroin.
A correspondent in the region says that Central Asia is a major route for the trafficking of drugs from Afghanistan, and officials say there has been a reduction in that flow since the American-led military operation in Afghanistan began last year.
Many believe the military operation disrupted networks which are now simply re-adjusting to the changed situation.
From the newsroom of the BBC World Service