For more than a decade, wads of U.S. dollars packed into suitcases, backpacks and, on occasion, plastic shopping bags have been dropped off every month or so at the offices of Afghanistan’s president — courtesy of the Central Intelligence Agency.

All told, tens of millions of dollars have flowed from the CIA to the office of President Hamid Karzai, according to current and former advisers to the Afghan leader.

“We called it ‘ghost money,’ ” said Khalil Roman, who served as Karzai’s chief of staff from 2002 until 2005. “It came in secret, and it left in secret.”

The CIA, which declined to comment for this article, has long been known to support some relatives and close aides of Karzai. But the new accounts of off-the-books cash delivered directly to his office show payments on a vaster scale, and with a far greater impact on everyday governing.

Moreover, there is little evidence that the payments bought the influence the CIA sought. Instead, some U.S. officials said, the cash has fueled corruption and empowered warlords, undermining Washington’s exit strategy from Afghanistan.

“The biggest source of corruption in Afghanistan,” one U.S. official said, “was the United States.”

The United States was not alone in delivering cash to the president. Karzai acknowledged a few years ago that Iran regularly gave bags of cash to one of his top aides.

At the time, in 2010, U.S. officials jumped on the payments as evidence of an aggressive Iranian campaign to buy influence and poison Afghanistan’s relations with the United States. What they did not say was that the CIA was also plying the presidential palace with cash — and unlike the Iranians, it still is.

U.S. and Afghan officials familiar with the payments said the agency’s main goal in providing the cash has been to maintain access to Karzai and his inner circle and to guarantee the agency’s influence at the presidential palace. The officials spoke about the money only on the condition of anonymity.

It is not clear that the United States is getting what it pays for. Karzai’s willingness to defy the United States — and the Iranians, for that matter — on an array of issues seems to have only grown as the cash has piled up.