KABUL, Afghanistan — Afghan opium cultivation again rose to historic levels in 2014, United Nations officials reported on Wednesday. And in a sign of how deeply entwined drug trafficking and the Afghan political system have become, the officials said the protracted elections this year were at least part of the cause.

“With the presidential election ongoing, there was a huge demand of funding,” said Jean-Luc Lemahieu, a senior official with the United Nations Office on Drugs and Crime. “And that funding is not available in the licit economy, and that money has to come from somewhere, so they turned to the illicit economy.”

Still, officials noted at least one encouraging sign, saying that the new government of President Ashraf Ghani had moved to arrest three judges accused of aiding the escape of a drug kingpin wanted by the United States.

The three judges accused of corruption are in custody in Kabul, according to Afghan and international officials. The men are accused of engineering the release of Haji Lal Jan Ishaqzai in June, as he was serving a 20-year sentence for drug trafficking.