The problem, as quantified by the United Nations Office on Drugs and Crime and other agencies, appears to be getting worse. In 2012, Afghanistan produced 95 percent of the world’s opium, with much of the product going to Iran, Europe and Russia. The following year, Afghan farmers grew an unprecedented 209,000 hectares (more than 516,000 acres) of opium poppy, outpacing the previous high of 193,000 hectares in 2007.

The value of last year’s yield was $3 billion, up from $2 billion in 2012, a 50 percent increase in a single year. One province, Nangarhar, was declared “poppy-free” by the United Nations in 2008, but between 2012 and 2013, it had a fourfold increase in production.

The narcotics program embraced multiple strategies, including interdicting drug traffickers, eradicating poppy fields, strengthening the Afghan legal system to prosecute drug dealers, persuading farmers to grow alternative crops and establishing treatment programs for addicts. The Pentagon, one of the lead agencies in the effort, has pinned the failure to reduce cultivation largely on a lack of support from the Afghan government.

It must also be said, however, that American, European, Afghan and United Nations officials at times sabotaged their own mission by bickering over how the money should be spent and where best to focus resources.

It seems unlikely that the new and still fragile Afghan government will soon do better on poppy eradication than the United States and its allies, whose forces in Afghanistan are expected to be reduced to 15,000 by the end of the year. The one bright spot is that Mr. Ghani seems to have a vision for what needs to be done. His campaign platform frankly acknowledged that legal farming in Afghanistan is less profitable and less efficient than the drug trade because it lacks an organized system of markets, financing, skilled workers and irrigation equipment. He has pledged to modernize farming and develop new markets for legitimate crops and other products.