Earlier this week, I cited recently declassified documents to show that Ronald Reagan did indeed play a major role in ending the Cold War. Now it’s time to note that a similar set of documents shows that Reagan also played a major role in bringing on the terrorist war that followed—specifically, in abetting the rise of Osama Bin Laden.

Once again, the story concerns the fascinating relationship between Reagan and Soviet leader Mikhail Gorbachev.

Gorbachev took the helm as the reform-minded general-secretary of the Communist Party of the Soviet Union in March 1985. Within months, he had decided privately to pull Soviet troops out of Afghanistan. One of his predecessors, Leonid Brezhnev, * had invaded Afghanistan in 1979, and the move was proving a disaster. Tens of thousands of Soviet troops had died; military morale was crumbling; popular protest—unheard of, till then, in Communist Russia—was rising. Part of the Soviet failure in Afghanistan was due to the fact that the Reagan administration was feeding billions of dollars in arms to Afghanistan’s Islamic resistance. Reagan and, even more, his intensely ideological CIA director, William Casey, saw the battle for Afghanistan as a titanic struggle in the war between Eastern tyranny and Western freedom. (Jimmy Carter and his national security adviser, Zbigniew Brzezinski, had started assisting the resistance, but with not nearly the same largess or ambition.)

At a Politburo meeting of Nov. 13, 1986, Gorbachev laid his position on the table: The war wasn’t working; it had to be stopped:

People ask: “What are we doing there?” Will we be there endlessly? Or should we end this war? … The strategic objective is to finish the war in one, maximum two years, and withdraw the troops. We have set a clear goal: Help speed up the process, so we have a friendly neutral country, and get out of there.

In early December, Gorbachev summoned President Najibullah, the puppet leader of Afghanistan, to give him the news: The Soviet troops would be leaving within 18 months; after that, he was on his own.

Two months later, on Feb. 23, 1987, Gorbachev assured the Politburo that the troops wouldn’t leave right away. He first had to foster a stable environment for the reigning government and to maintain a credible image with India, the Soviet Union’s main ally in the region. The exit strategy, he said, would be a negotiated deal with Washington: The Soviets pull out troops; the Americans stop their arms shipments to the rebels.

However, within days, Gorbachev learned to his surprise that Reagan had no interest in such a deal. In a conversation on Feb. 27 with Italy’s foreign minister, Giulio Andreotti, Gorbachev said, “We have information from very reliable sources … that the United States has set itself the goal of obstructing a settlement by any means,” in order “to present the Soviet Union in a bad light.” If this information is true, Gorbachev continued, the matter of a withdrawal “takes on a different light.”

Without U.S. cooperation, Gorbachev couldn’t proceed with his plans to withdraw. Instead, he allowed his military commanders to escalate the conflict. In April, Soviet troops, supported by bombers and helicopters, attacked a new compound of Islamic fighters along the mountain passes of Jaji, near the Pakistani border. The leader of those fighters, many of them Arab volunteers, was Osama Bin Laden.

In his magisterial book, Ghost Wars (possibly the best diplomatic history written in the past decade), Steve Coll recounts the fateful consequences:

The battle lasted for about a week. Bin Laden and 50 Arab volunteers faced 200 Russian troops. … The Arab volunteers took casualties but held out under intense fire for several days. More than a dozen of bin Laden’s comrades were killed, and bin Laden himself apparently suffered a foot wound. … Chronicled daily at the time by several Arab journalists … the battle of Jaji marked the birth of Osama bin Laden’s public reputation as a warrior among Arab jihadists. … After Jaji he began a media campaign designed to publicize the brave fight waged by Arab volunteers who stood their ground against a superpower. In interviews and speeches … bin Laden sought to recruit new fighters to his cause and to chronicle his own role as a military leader. He also began to expound on expansive new goals for the jihad.

Had Gorbachev thought that Reagan was willing to strike a deal, the battle of Jaji would not have taken place—and the legend of Bin Laden might never have taken off.

Reagan can’t be blamed for ignoring the threat of Osama Bin Laden. Not for another few years would any analyst see Bin Laden as a significant player in global terrorism; not till the mid-1990s would his organization, al-Qaida, emerge as a significant force.

However, Reagan—and those around him—can be blamed for ignoring the rise of Islamic militancy in Afghanistan and for failing to see Gorbachev’s offer to withdraw as an opportunity to clamp the danger. Certainly, the danger was, or should have been, clear. Only a few years had passed since the Ayatollah Khomeini rose to power in Iran—the shah toppled, the U.S. Embassy employees held hostage, the country turned over to the mullahs, the region suddenly destabilized. Reagan beat Jimmy Carter so decisively in the 1980 election in part because of the hostage crisis.

Gorbachev had accepted that Afghanistan would become an Islamic country. But he assumed that Reagan, of all people, would have an interest in keeping it from becoming militantly, hostilely, Islamist.

In September 1987, after the previous spring’s escalation failed to produce results, Soviet Foreign Minister Edvard Shevardnadze met with Secretary of State George Shultz to tell him that Gorbachev planned to pull out of Afghanistan soon. He asked Shultz for help in containing the spread of “Islamic fundamentalism.” Shultz had nothing to say. Most Reagan officials doubted Gorbachev would really withdraw, and they interpreted the warnings about Muslim radicals as a cover story for the Soviet Union’s military failure.

By this time, Reagan and Gorbachev had gone some distance toward ending the Cold War. The dramatic moment would come the following spring, during the summit in Moscow, when Reagan declared that the U.S.S.R. was no longer an “evil empire.” At the same time, though, the U.S. national-security bureaucracy—and, in many ways, Reagan himself—continued to view the world through Cold War glasses.

After the last Soviet troops departed, Afghanistan fell off the American radar screen. Over the next few years, Shevardnadze’s worst nightmares came true. The Taliban rose to power and in 1996 gave refuge to the—by then—much-hunted Bin Laden.

Ten years earlier, had Reagan taken Gorbachev’s deal, Afghanistan probably still wouldn’t have emerged as the “friendly, neutral country” of Gorby’s dreams. Yet it might have been a neutral enough country to preclude a Taliban takeover. And if the Russian-Afghan war had ended earlier—if Reagan had embraced Gorbachev on the withdrawal, as he did that same autumn on the massive cutback of nuclear weapons—Osama Bin Laden today might not even be a footnote in history.

Correction, June 11: Leonid Brezhnev was general-secretary of the Communist Party of the Soviet Union at the time of the Afghanistan invasion, not Yuri Andropov as the article originally stated. (Return to the corrected sentence.)