Wikileaks' papers are just the latest Afghan military shockers to surface. Remember Reagan and the Pakistani spooks?

The "most damning collection of data" in Wikileaks' massive trove of secret documents from Afghanistan are 180 files that show the Pakistani intelligence service helping Taliban insurgents in their fight against US forces. The documents are dark reading indeed: They describe Pakistani agents meeting directly with the Taliban, supporting commanders of the insurgency, and even training suicide bombers. But for anyone versed in the contemporary history of Afghanistan, they are hardly news. The Wikileaks data dump is just the tip of the iceberg; ISI black ops and double-crosses date back at least three decades. Pakistan's Directorate for Inter-Services Intelligence, or ISI, is merely feeding a monster it helped create back in the 1990s—with the full knowledge of the United States. Indeed, in concert with the CIA, the Pakistani spy agency also helped create Al Qaeda, and continued to support it long after it had gone astray of US interests.

That context is especially useful now. I explored the Taliban's history in my 2005 book The Five Unanswered Questions About 9/11, which asked, did US 'allies' help make the attacks possible?" Most of what follows is adapted from that book.

After the Soviet invasion of Afghanistan in 1979, the Pakistani intelligence service became a key part of the CIA's strategy in the country, where a full-scale covert war was carried out under Ronald Reagan, with hundreds of millions in funding eventually provided by Congress.

As meticulously described by Steve Coll in his Pulitzer Prize-winning 2005 book Ghost Wars, the covert operation took place under the zealous leadership of then-CIA Director William J. Casey, to whom Afghanistan represented an opportunity to fight the Soviets right on their own border. It was an opportunity for Pakistan, as well: As Soviet journalist Artyom Borovik wrote in his 1990 book The Hidden War, Pakistan's leader General Mohammed Zia-ul-Haq "saw in the Afghan conflict a unique opportunity to obtain a sharp increase in US military and financial aid to Pakistan. The Pakistani generals regarded the entrance of Soviet troops into Afghanistan as 'Brezhnev's gift.'" Over the next seven years, Reagan would engineer more than $7 billion in aid to Pakistan.

The result was a deadly troika joining the Pakistani secret service, the Taliban, and Al Qaeda.

Zia was more than willing to support Casey's strategy, which included both funding the Afghan mujahaddin and attracting an international force of Islamic militants to fight the Russians in Afghanistan. According to Ahmed Rashid's 2000 book Taliban, Pakistan issued standing orders to all its embassies to grant visas to anyone who wanted to come and fight with the mujahaddin. As a result, a growing force of Muslims from around the world gathered in camps in easternmost Afghanistan, just across the Pakistani border. These camps, Rashid notes, became "virtual universities for future Islamic radicalism."

One of those in attendance was a wealthy Saudi named Osama Bin Laden. "I settled in Pakistan in the Afghan border region," he said in a 1998 interview with Agence France-Presse. "There I received volunteers who came from the Saudi kingdom and from all over the Arab and Muslim countries. I set up my first camp where these volunteers were trained by Pakistani and American officers. The weapons were supplied by the Americans, the money by the Saudis." Later, he said, "I discovered that it was not enough to fight in Afghanistan, but that we had to fight on all fronts, communist or western oppression."

In his 1992 book Afghanistan The Bear Trap, Mohammad Yousaf, the ISI operations chief for the Afghanistan campaign, wrote that most of the US money and supplies for the militant forces were channeled right to the ISI, which then made the decisions as to which commanders in Afghanistan got what weapons. The ISI maintained four base commands within Afghanistan, and they in turn reached out to smaller units, organized around clans and villages.

As reported in the Asian edition of the Financial Times, in the early 1980s, the ISI even "started a special cell for the use of heroin for covert actions"—initiated, according to the article, "at the insistence of the Central Intelligence Agency." This cell "promoted the cultivation of opium and the extraction of heroin in Pakistani territory as well as in the Afghan territory under mujahideen control for being smuggled into the Soviet controlled areas in order to make the Soviet troops heroin addicts. After the withdrawal of the Soviet troops, the ISI's heroin cell started using its network of refineries and smugglers for smuggling heroin to the Western countries and using the money as a supplement to its legitimate economy. But for these heroin dollars, Pakistan's legitimate economy must have collapsed many years ago....Not only the legitimate State economy, but also many senior officers of the Army and the ISI benefited from the heroin dollars."

By the time Mikail Gorbachev pulled Soviet forces out of Afghanistan in 1989, reports and complaints about the growing force of militant Islamic volunteers began to come back to the CIA. But with the Soviet withdrawal, and the subsequent collapse of the Soviet Union and demise of the Cold War, the United States lost all interest in Afghanistan. It left behind a heavily armed, heavily mined, and destitute country in a state of virtual anarchy. As the leaders of former mujaheddin factions fought one another for control, Afghan and Pakistani students were building a new political movement, which would call itself the Taliban. This movement grew up around the thousands of madrassahs, or religious schools, that had taken root within Pakistan along the northwestern Afghan border. The founders of the new Taliban had no trouble finding recruits in the madrassahs, and in the crowded refugee camps on the Afghan-Pakistani border, and they soon became a force to reckon with within the warring factions in Afghanistan.

Among those keeping their eye on the growing Taliban movement was the ISI, long a major instrument of Pakistani foreign policy. The jihadists within the Pakistani government, and especially within the intelligence service, were unstinting in their support of the Taliban, and the ISI as a whole looked upon the Taliban with increasing favor. The ISI would be instrumental in bringing the Taliban to power, and would continue to provide them aid and advice in managing the country once they had assumed control. As Ahmed Rashid describes, it, at times, Afghanistan almost seemed to be an administrative appendage of Pakistan.

At the same time, the cadre of militant Islamic guerrilla fighters who had converged from across the Islamic world were determined to maintain Afghanistan as a headquarters for future jihads. The time was ripe for the completion of what would prove a deadly troika joining the Pakistani secret service, the Taliban, and Al Qaeda.

After detours to Saudi Arabia and the Sudan, Bin Laden and dozens of his supporters was back in to Afghanistan in 1996 to witness the triumph of the Taliban. Here, again, Pakistan played a decisive role. As the 9/11 Commission report acknowledged, "Though his destination was Afghanistan, Pakistan was the nation that held the key to his ability to use Afghanistan as a base from which to revive his ambitious enterprise for war against the United States." Pakistan would continue to be the source of madrassah-bred militants, and clearly hoped that the Taliban and its like "perhaps could bring order in chaotic Afghanistan and make it a cooperative ally."

"It is unlikely," the Commission continues, "that Bin Laden could have returned to Afghanistan had Pakistan disapproved. The Pakistani military and intelligence services probably had advance knowledge of his coming, and its officers may have facilitated his travel... Pakistani intelligence officers reportedly introduced Bin Laden to Taliban leaders in Kandahar, their main base of power, to aid his reassertion of control over camps near Khowst, out of an apparent hope that he would now expand the camps and make them available for training Kashmiri militants" for Pakistan's ongoing standoff with India.

Bin Laden himself acknowledged his debt to the ISI, which he surely must have had in mind when he told ABC, in a 1999 interview, "As for Pakistan, there are some governmental departments which, by the grace of God, respond to Islamic sentiments of the masses in Pakistan. This is reflected in sympathy and cooperation. However, some other governmental departments fell into the trap of the infidels. We pray to God to return them to the right path."

Cementing his relationship with the new Taliban regime (to which he brought considerable monetary support), Bin Laden helped expand the jihadist training camps in the safe sanctuary of Afghanistan; these camps, according to US intelligence estimates, trained 10,000 to 20,000 fighters between his 1996 return and September 11, 2001.

In February 1998, Bin Laden issued his famous fatwa. Less than six months later, on August 7, 1998, Al Qaeda carried out its most devastating terrorist attacks up to that time, on the US embassies in Nairobi and Dar es Salaam, killing 224 and injuring more than 5,000. In the days following the embassy bombings, the CIA learned military and extremist groups would be gathering on August 20 at a camp near Khost in eastern Afghanistan. The reports said Bin Laden was expected. As Steve Coll recounts, this appeared to be the moment to respond with force to the embassy attacks and kill Bin Laden. The Clinton Administration planned a surprise cruise missile attack on the camp—but it turned out to be anything but a surprise. The US's Tomahawk missiles killed twenty-odd Pakistani jihad fighters, but Bin Laden and other leaders were not there. According to Coll, the ISI knew of the attacks, and there were suggestions that it had warned Bin Laden.

At the time, the ISI was headed by Hamid Gul (who resurfaces in the WikiLeaks documents as a liaison between the ISI and the Taliban). By all appearances, Gul was dedicated to protecting the Taliban, which in turn maintained close ties with Al Qaeda. In his 2004 book Against All Enemies, former terrorism "czar" Richard Clarke writes, "I believed that if Pakistan's ISID [ISI] wanted to capture bin Laden or tell us where he was, they could have done so with little effort. They did not cooperate with us because ISID saw al Qaeda as helpful to the Taliban. They also saw al Qaeda and its affiliates as helpful in pressuring India, particularly in Kashmir. Some, like General Hamid Gul, ... also appeared to share bin Laden's anti-Western ideology."

Yet when the United States repeatedly asked the ISI to provide Bin Laden's location for a US attack, Paskistani intelligence officers told the CIA that Al Qaeda no longer trusted them, so they could not pinpoint his whereabouts. According to Coll, "The Americans doubted this. . . . Pakistan's army and political class had calculated that the benefits they reaped from supporting Afghan-based jihadist guerrillas—including those trained and funded by Bin Laden—outstripped the costs, some of Clinton's aides concluded. As one White House official put it bluntly, 'Since just telling us to fuck off seemed to do the trick,' why should the Pakistanis change their strategy?" The CIA, in tracking Bin Laden, had desperately—and foolishly—turned to its old ally the ISI, which had been so useful during the Soviet occupation of Afghanistan.

But the situation a decade later was quite different. Now, the United States wanted the Pakistanis to help them quell the rise of Islamic extremism, rather than encourage it. Some lip service was given to cooperation on both sides. The Pakistani government wanted to preserve a decent relationship with the United States, especially in 1998, when it was conducting tests of nuclear weapons. But it never took any real action to limit the ISI's support of the Taliban or Al Qaeda. And the ISI, always an entity unto itself, did worse than nothing. There can be little doubt that many ISI operatives were functioning, in effect, as double agents, getting information from the CIA, and passing it on either directly to Bin Laden, or to the Taliban, which in turn informed Bin Laden. ISI operatives were clearly involved in destroying enemies that threatened the Taliban. In early 1999, after Abdul Haq, a respected anti-Soviet fighter and Pashtun warlord, became an independent voice and stood up against the Taliban, the ISI called on him and told him to shut up. Haq paid them no heed. On returning later, he found his children and wife murdered. Several sources trace the attack to the ISI. The ISI would subsequently be implicated in Haq's murder, as well as the murder of legendary Northern Alliance mujahedeen leader Ahmed Shah Massoud.

When General Pervez Musharaff took power in a 1999 coup, he appointed as his new ISI chief Lt. General Mahmoud Ahmed. Always a strong supporter of the Taliban, Mahmoud himself soon found new meaning in religion and started calling himself a "born again Muslim." As Steve Coll writes, by the summer of 2000, the longstanding relationship between the ISI and the CIA had "turned icy."

According to the 9/11 Commission report, based on testimony from Khalid ShEikh Mohammed and other captured operatives, a major strategy debate took place in the spring and summer of the 2001. The Taliban's debating partner was Al Qaeda, and subject was the wisdom of launching the planned direct attacks on the United States.

As the Taliban leadership became aware of the attack plans, they initially opposed them. Their first priority was defeating the Northern Alliance, which continued to control portions of Afghanistan and launch attacks on the Taliban. They were depending on military equipment and support from Al Qaeda. An attack on the United States might be counterproductive in that it would draw the US into an Afghan conflict on the side of the Northern Alliance.

Taliban leader Mullah Omar also opposed Bin Laden's plans on ideological grounds, preferring to attack Jews and not necessarily the United States. Khalid Sheikh Mohammed also subsequently claimed that Omar was under pressure from Pakistan to keep Al Qaeda operations inside Afghanistan. Matters came to a head at an Al Qaeda shura council meeting. While several top Al Qaeda leaders sided with the Taliban, Bin Laden overrode his opponents, asserting that Omar had no authority to stop jihads outside of Afghanistan's borders.

Given the Taliban's intimate knowledge of the plan for the 9/11 attacks—the debate within the top ranks of the Taliban and Al Qaeda, a shura council meeting, and the suggestion Pakistan was pressuring Omar to keep Al Qaeda inside Afghanistan—it seems that the ISI must have known what was about to happen. It did nothing to warn its old friends in the CIA of the worst attack ever to take place on American soil.

In a so-called ally, this was treachery of the highest order. Yet even in the wake of the 9/11 attacks and in the midst of the Afghanistan war, the ISI has clearly continued to support the Taliban, with relatively little resistance either from its own government or from the United States.

As Peter Galbraith, former UN deputy special representative in Afghanistan, wrote earlier this week in the Guardian, "President Bush could have forced Pakistan to break the ISI-Taliban nexus but did not." Bush was dealing with President Pervez Musharraf who, Galbraith says, "as the country's military dictator, presumably did control the ISI. Bush, who liked to talk tough but rarely was, preferred to accept Musharraf's false assurance that Pakistan was not supporting the Taliban connection to the unpleasant task of having to put pressure on an ally."

Obama, on the other hand, is dealing with a civilian government that has reason to genuinely hate the Taliban: President Asif Ali Zardari's wife, Benazir Bhutto, was murdered by Taliban-linked militants (possibly with the tacit complicity of ISI officials). But Galbraith believes that, "Zardari does not control the ISI."

Statements from the Obama administration in response to the WikiLeaks documents seem not to acknowledge any gap between the Pakistani government and its rogue intelligence agency. Instead they emphasize positive developments in the relationship between the two countries—behaving, to all appearances, as if the past 30 years of history simply did not exist. According to a report in Tuesday's Wall Street Journal, "US officials contend that in the past several months, Pakistan's stance has become much more nuanced than portrayed in the WikiLeaks reports." These unnamed officials claim that they are aware of past problems and that "everyone's eyes are wide open." They also insist, however, that "the two nations have made strides in deepening military and civilian ties... In return, the US has pledged billions of dollars in new military and civilian aid."