CHANDIGARH, India—Just after midnight, Indian forces patrolling the country’s frontier with Pakistan closed in on a group of armed smugglers.

A firefight erupted. When the shooting stopped, two men were dead. Three others were apprehended and their cargo, 33 pounds of heroin, confiscated.

Nearly half of India’s heroin seizures, like this one in June, are made here in Punjab, a northern state that has become a conduit for drugs from the terror-funding opium fields of Afghanistan to markets across Asia, Europe and elsewhere, authorities say.

Illegal narcotics and their legacy of addiction, disease and social upheaval in Punjab were recently the subject of a controversial movie that set off a debate ahead of upcoming state elections.

But Indian antinarcotics and intelligence officials say the damage goes much further. Overlapping groups of drug traffickers, criminals and Islamist fighters in Pakistan, they say, are ferrying anti-India Muslim extremists, counterfeit currency and weapons across the border. Authorities suspect the sale of heroin also helps finance jihadist attacks.