A notorious Afghan drug trafficker was sentenced Tuesday to life in prison for using proceeds of one of the world’s largest heroin distribution operations to support the Taliban insurgency.

Haji Bagcho manufactured heroin in secret laboratories along Afghanistan’s border with Pakistan and sent drugs to more than 20 countries. He was arrested in May 2009 and brought to the United States to face charges following a years-long investigation by Afghan and American authorities. Prosecutors said his vast drug trafficking network in eastern Afghanistan produced hundreds of thousands of kilograms of heroin, including shipments intended for the U.S., and funneled proceeds to high-level Taliban officials who protected him from police there.