President Ronald Reagan with Soviet leader Mikhail Gorbachev in Geneva in 1985. Reagan believed that Gorbachev was a new type of Soviet leader dedicated to real reform. (Dennis Paquin/Reuters)

James Mann is a fellow in residence at Johns Hopkins School of Advanced International Studies and the author of “The Rebellion of Ronald Reagan.”

After President Obama concluded his nuclear agreement with Iran this summer, not only Obama’s supporters but even Brent Scowcroft, the national security adviser in two Republican administrations, compared the deal to President Ronald Reagan’s diplomacy with the Soviet Union.

A number of foreign policy hawks were outraged, calling these Reagan analogies preposterous. Unlike Obama with Iran, the hawks argued, Reagan waged unending ideological warfare against the Soviet Union, branding it the “evil empire.” And, they contended, Reagan never believed that the Soviet leadership was capable of change. “There is no comparison between these two men,” wrote Robert McFarlane, one of Reagan’s six national security advisers.

But Robert Service’s new book, “The End of the Cold War: 1985-1991,” serves as a reminder that the hawks’ memory of Reagan’s Soviet diplomacy is selective and, ultimately, just plain inaccurate. The hawks do have Reagan right for his first four years in office, but they are either forgetting or are ignorant of what happened in his second term, after Mikhail Gorbachev became the Soviet leader in 1985. Whatever one might think of Obama’s diplomacy with Iran, the comparison to Reagan is not nearly so far-fetched as the hawks claim.

As Service shows, there was indeed an intense, continuing debate in Washington during Reagan’s second term about whether Gorbachev represented a change in the Soviet leadership and whether his reform program was for real. At the time, hawks such as Defense Secretary Caspar Weinberger, CIA Director William Casey and the CIA’s top Soviet expert, Robert Gates, argued that Gorbachev was, in Casey’s words, “a traditionalist who would continue to confront America, bully Eastern Europe and stay put in Afghanistan.”

‘The End of the Cold War: 1985-1991’ by Robert Service (PublicAffairs)

But Reagan gradually rejected this view. Instead, to the growing dismay of the hawks of that era, he supported others in Washington, particularly Secretary of State George P. Shultz, who believed that Gorbachev was in fact a different sort of Soviet leader who intended to shake up traditional Soviet policies. Reagan decided to do business with Gorbachev in a way that would give the new leader the time and space to proceed with his programs of perestroika and glasnost. “Gorbachev sought to boost his image through the medium of international acclaim,” Service writes. Grasping this, Reagan “decided that conciliation was in the national interest.”

By Reagan’s final two years in the White House, he “had made his definitive choice in policy” to support Shultz’s view that Gorbachev represented change. Hawks such as Weinberger began leaving his administration, conservative columnists such as William Buckley and George Will angrily criticized Reagan, and the president himself reined in his earlier ideological attacks. On a visit to Moscow in 1988, Reagan was asked whether he still considered the Soviet Union to be an evil empire. “No,” he replied. “I was talking about another time and another era.” Why? Because, he said, Gorbachev was a different sort of leader.

Service’s book covers, in considerable detail, the American debates of the final years of the Cold War. Its principal strength, however, lies in his descriptions of what was going on in Moscow in those final years. As a historian, Service has specialized for much of his career in biographies of Soviet leaders: Lenin, Stalin and Trotsky. In writing about the end of the Cold War, he gravitated naturally toward Russian archival material, principally the memoirs and oral histories of a range of Soviet leaders, their aides and diplomats.

The reliance on these archives and Service’s dense writing style sometimes give the book a musty feel. It is considerably less readable than books about the end of the Cold War written by journalists who were based in the Soviet Union at that time, such as David Remnick’s “Lenin’s Tomb” and Michael Dobbs’s “Down With Big Brother.” At times, such as in Service’s account of the Malta summit between Gorbachev and President George H.W. Bush, he lapses into merely rewriting the memoranda of their conversations, so the prose reads like a communique: “The two leaders . . . promised to look at global ecological questions. They agreed on increasing cultural exchange.”

Yet Service does succeed in giving the reader a comprehensive account of the meetings and debates in the years leading up to the Soviet collapse. He deserves credit, too, for going beyond the Soviet-American diplomacy to give, at each juncture, the various perspectives of other leaders, especially British Prime Minister Margaret Thatcher, French President François Mitterrand and West German Chancellor Helmut Kohl.

And, even through his mostly dense account, a certain liveliness bursts forth. After a visit to East Berlin in the fall of 1989, we learn, Gorbachev confided to his advisers that he thought East Germany’s longtime leader, Erich Honecker, was “an arsehole.” Writing about the frail, ailing Soviet leaders who preceded Gorbachev, Service unearths a telling detail: a new Politburo rule adopted in 1983 requiring officials over the age of 65 not to begin work until 10 a.m., to take one day off per week and to go off on 2 1/2 months of vacation per year.

Gorbachev was chosen in large part because he was younger, healthy and likely to last as Soviet leader. But as he proceeded with his reform program, the Soviet economy continued to deteriorate. Service provides a fine portrait of Gorbachev’s increasing desperation, to the point where he warned Reagan’s successor, Bush, that there would be a “disaster” unless the Soviet Union got economic help from abroad.

The story of the final years of the Cold War takes on new poignancy with the passage of time. Next month will mark the 25th anniversary of the day when Gorbachev’s top aide, Foreign Minister Eduard Shevardnadze, handed in his resignation and issued a famous admonition to Gorbachev, an event that set the stage for the Soviet breakup 12 months later. Perceiving that the KGB and the security agencies had had enough of Gorbachev’s reforms and would move against him, Shevardnadze declared: “A dictatorship is on the way. Nobody knows what kind of dictatorship it will be, who will come to power, what kind of dictator or what kind of order will be installed.”

A coup attempt against Gorbachev failed the following year, paving the way for a more democratic Russia. And indeed, throughout the 1990s, Shevardnadze’s warning about dictatorship seemed exaggerated. Over the longer run, however, a veteran of the KGB emerged in Russia assuming ever greater powers. It turned out that, in a way, Shevardnadze had been right.

The End of the Cold War

By Robert Service

PublicAffairs. 643 pp. $35