By MIRWAIS KHAN and SEBASTIAN ABBOT
The Associated Press

KANDAHAR, Afghanistan — As the United States and Pakistan reached a deal to end Pakistan's seven-month blockade of supplies for NATO troops in Afghanistan, another group privately cheered its good fortune: the Taliban.

One of the Afghan war's great ironies is that both NATO and the Taliban rely on the convoys to fuel their operations — a recipe for seemingly endless conflict.

The insurgents have earned millions of dollars from Afghan security firms that illegally paid them not to attack trucks making the perilous journey from Pakistan to coalition bases throughout Afghanistan — a practice the U.S. has tried to crack down on but admits likely still occurs.

Militants often target the convoys in Pakistan as well, but there have been far fewer reports of trucking companies paying off the insurgents, possibly because the route there is less vulnerable to attack.

Pakistan's decision to close its border to NATO supplies in November, in retaliation for U.S. airstrikes that killed 24 Pakistani troops, significantly reduced the flow of cash to militants operating in southern and eastern Afghanistan, where the convoys travel up from Pakistan, said Taliban commanders.

Pakistan reopened the supply route in early July after the U.S. apologized for the deaths of the soldiers. The two countries signed a formal agreement regulating the shipment of troop supplies to and from Afghanistan on Tuesday.

The pact formalizes some key details, including a ban on transporting lethal equipment. It also says that Pakistan will provide security for the thousands of container trucks and oil tankers whose routes originate at the port of Karachi.

Last week, after the war-provisioning convoys began rolling in significant numbers, Pakistan again shut down the routes when a trucker was fatally shot in an attack attributed to the Pakistani Taliban, which has vowed to kill anyone who drives for NATO.

Pakistani officials said Tuesday that the convoys would resume only after the routes — which span hundreds of miles — are suitably protected. Under the new arrangement, police in cities and towns would handle security until the convoys reach the restive tribal areas bordering Afghanistan, where the nation's paramilitary Frontier Corps would take over.

"Stopping these supplies caused us real trouble," said a Taliban commander who leads about 60 insurgents in eastern Ghazni province. "Earnings dropped down pretty badly. Therefore the rebellion was not as strong as we had planned."

The U.S. military estimated last year that $360 million in U.S. tax dollars ended up in the hands of the Taliban, criminals and power brokers with ties to both. More than half the losses flowed through a $2.1 billion contract to truck huge amounts of food, water and fuel to American troops across Afghanistan.

The military said only a small percentage of the $360 million was funneled to the Taliban and other insurgent groups. But even a small percentage would mean millions of dollars, and the militants, who rely on crude weaponry, require relatively little money to operate.

The military investigated one power broker who owned a private security company and was known to supply weapons to the Taliban. The power broker, who was not named, received payments from a trucking contractor doing business with the U.S. Over more than two years, the power broker funneled $8.5 million to the owners of an unlicensed money exchange service used by insurgents.

A congressional report in 2010 called "Warlord, Inc." said trucking contractors pay tens of millions of dollars annually to local warlords across Afghanistan in exchange for guarding their supply convoys, some of which are suspected of paying off the Taliban.

The military instituted a new, roughly $1 billion trucking contract last September with a different set of companies that it claims has reduced the flow of money to insurgents by providing greater visibility of which subcontractors those firms hire, said Maj. Gen. Richard Longo, head of a U.S. anti-corruption task force in Afghanistan.

But it's very difficult to cut off the illegal transfers completely, he said.

"I think it would be naive on my part to suggest that no money is going to the enemy," said Longo. Rep. John Tierney, the Democrat from Massachusetts who led the Warlord, Inc. report, said the new contract has resulted in some increased contractor oversight and accountability, but "the Department of Defense must take more aggressive steps to keep our military personnel safe and to protect taxpayer dollars from going to our enemies in Afghanistan."

The U.S. pushed Pakistan hard to reopen the NATO supply line through the country because it had been forced to use a longer route that runs into northern Afghanistan through Central Asia and costs an additional $100 million per month.

Taliban commanders interviewed by the AP said the northern route was less lucrative for them because fewer trucks passed through southern and eastern Afghanistan, and contractors seemed to have less money to direct toward the insurgents. It's unclear if that is a result of the new trucking contract implemented by the military.

But the commanders said they were determined to get their cut as the flow of trucks resumes from Pakistan — a process that has been slowed by bureaucratic delays, disputes over compensation and concerns about security.

Before the November attack, the U.S. and other NATO countries shipped about 30 percent of their nonlethal supplies from Pakistan's southern port city of Karachi through two main crossings on the Afghan border.

The route through Pakistan will become even more critical as the U.S. seeks to withdraw most of its combat troops by the end of 2014, a process that will require tens of thousands of containers carrying equipment and supplies.