WASHINGTON -- Among the crush of foreign dignitaries paying final respects to Ronald Reagan at the National Cathedral today will be one man -- recognizable by his intense gaze, easy grin and the rose-colored birthmark on his forehead -- who shares history's accolades for lifting the threat of nuclear war between the United States and the Soviet Union.

Mikhail S. Gorbachev, 73, cuts a much-diminished figure at home nowadays, despised by many fellow Russians for presiding over the collapse of a Communist empire that once stretched from Central Europe to the Pacific and spread its influence deep into the Middle East, Africa and Latin America.

In America this week, the former Soviet leader's name has most often been heard in video clips of Reagan at Berlin's Brandenburg Gate in 1987, demanding freedom for the millions of people trapped behind the Cold War's most potent symbol: "Mr. Gorbachev, tear down this wall."

But that oratorical challenge obscured a budding partnership between two leaders who were able to dispel each other's suspicions, rise above their hard-line ideologies and cut through bureaucratic interests to end a generation of East-West hostility.

It wasn't just Reagan's determined military buildup that brought Gorbachev to agree to destroy midrange nuclear missiles pointed at Western Europe, set a course for deep cuts in long-range missiles, end Soviet-backed wars in Afghanistan and Central America and, finally, let Eastern Europe find its own destiny.

"I think it took both of them. They both had specific qualities that allowed them to do something that was extremely difficult for others to do," said Jack F. Matlock Jr., Reagan's top Soviet specialist and later ambassador to Moscow, who has written a book about the relationship between the two leaders.

Reagan was driven by a horror of nuclear weapons, according to Matlock: "He found [the concept of] mutual assured destruction absolutely abhorrent. He doubted he could ever authorize their use."

Gorbachev needed an end to the Cold War to advance his domestic reforms of economic, political and social restructuring, dubbed perestroika, and greater openness, called glasnost.

Neither side approached the other easily. Soviet intelligence painted Reagan as a "rabid, anti-Soviet conservative," recalled Oleg Kalugin, who was a major general in the KGB. Reagan's director of central intelligence, William J. Casey, didn't believe Gorbachev was a real reformer.

Reagan began his long preparations to negotiate in 1983, in the midst of his arms buildup, undergoing a virtual graduate course on the Soviet Union capped by a lengthy video on Gorbachev prepared by the CIA.

Reagan went to his first meeting with Gorbachev in Geneva two years later confident of his powers of persuasion, believing, as he later wrote in his autobiography, that he could "get him in a room alone and set him straight."

Reagan wrote that he found "something likable about Gorbachev. There was warmth in his face and his style." The Soviet leader "seemed to nod in agreement" after Reagan called for using the opportunity to build trust and confidence in each other.

Their next meeting, in Reykjavik, Iceland, in 1986, ended badly, with Reagan walking out in fury after Gorbachev insisted that the United States abandon its infant missile-defense program as part of a sweeping deal to phase out all nuclear weapons.

But Reagan and others later viewed the meeting as a turning point that helped set the stage for future agreements. Anatoly Dobrynin, the long-serving Soviet ambassador to Washington, agrees. At Reykjavik, Gorbachev "decided that he could and would work with Reagan. He saw in him a person capable of taking great decisions," the envoy wrote in his memoirs.

Economic pressure on the Soviet Union spurred cooperation. "The Reagan military buildup forced the Soviets to face the consequences of their lopsided system, where tremendous resources were spent on military hardware while nonmilitary needs were not getting attention," said Angela Stent, director of Georgetown University's Center for Eurasian, Russian and East European Studies.

The next year, Gorbachev told the Soviet Politburo that the arms race had to be ended before the United States used it to bankrupt the Soviet Union.

Reagan responded with more flexibility than was evident at the time, when superpower relations were still roiled by mutual expulsions of diplomats several months earlier over charges of espionage.

In a crucial move, he was willing to face down what he later described as "lots of flak" from hard-line conservatives and Pentagon foes of arms control.

"You had to have an American president who could not be outflanked from the right," Matlock said.

Nancy Reagan's influence was "very important," he added. "She definitely wanted to cool the [anti-Soviet] rhetoric. She wanted him to be a peace president."

By December 1987, when Gorbachev arrived in the United States to sign an agreement eliminating midrange missiles in Europe, the two leaders' relationship had struck a deep chord in both populations.

Americans engulfed the Soviet leader in a wave of "Gorby-mania." The following year, Reagan got a more restrained but still enthusiastic response on a visit to Moscow. Months after he left office in early 1989, 16.5 percent of Soviet citizens picked Reagan as man of the year.

Gorbachev's admiration for Reagan endures. "I don't know whether we would have been able to agree and to insist on the implementation of our agreements with a different person at the helm of American government," he wrote in an article for The New York Times after Reagan's death.

The timing of the collapse of the Soviet Union and the peaceful way it occurred were not inevitable, Matlock believes, and had much to do with the Reagan-Gorbachev partnership: "The end of the Cold War made it possible to dissolve the Soviet Union peacefully."

For Gorbachev, the end of the Cold War came with bitter irony. It unleashed built-up political and social pressures that by 1991 caused the Soviet Union to collapse and pushed him from office.

Signs of disintegration had already appeared when he and Reagan held their last official meeting in New York in January 1989 and reminisced about their first session in Geneva.

Where once he took Washington by storm, his sleek Zil limousine drawing cheering crowds, Gorbachev caused barely a stir yesterday when he joined thousands of mourners who passed Reagan's flag-draped coffin in the Capitol Rotunda. He stood solemnly a few feet from the casket, then leaned in, placed his hand on it, seemed to say a few words and walked on.

Sun staff writers Tom Bowman and Julie Hirschfeld Davis contributed to this article.