Anatoly S. Chernyaev, a crucial adviser to Mikhail S. Gorbachev as he tried to refashion the Soviet Union’s relations with the West, died on March 12 in Moscow. He was 95.

The Gorbachev Foundation announced his death. He had been treated for a respiratory ailment for several weeks, a friend said.

As a close aide to Mr. Gorbachev, the last Soviet leader, on both foreign and domestic affairs, Mr. Chernyaev (pronounced churn-YAI-yev) played a central role in his bold attempt to modernize and liberalize the Soviet Union and was with him at a vacation house during the short-lived coup against him in 1991 and when he stepped down at the end of that year.

Mr. Chernyaev went on to become deeply disillusioned by the revanchist rule in Russia of President Vladimir V. Putin, acquaintances said.

“He was one of the key actors in ending the Cold War,” said Svetlana Savranskaya, who is director of Russian programs at the archive, a research center at George Washington University, and who is editing the diaries. “It’s hard to overestimate his role in pushing Gorbachev toward arms control, mutual security and the integration of Russia into Europe.”

William Taubman, a professor at Amherst College and author of a forthcoming Gorbachev biography, said that while Mr. Chernyaev was Mr. Gorbachev’s main foreign policy adviser, Mr. Gorbachev “consulted him endlessly on domestic matters as well” and once described him as his “alter ego.”

Anatoly Sergeyevich Chernyaev was born into an aristocratic Russian family on May 26, 1921, during the civil war that followed the Bolshevik seizure of power. His father, Sergey, was an engineer, and a grandfather had been a general in the czarist army. Anatoly was privately tutored in French and German as a child.

He and his family viewed Stalin, who ruled until his death in 1953, as a “crude, ignorant, completely alien force,” Professor Taubman said. But Mr. Chernyaev’s path nonetheless took him directly into the Soviet political mainstream.

He served in the Soviet Army in World War II before graduating from the history faculty of Moscow State University and teaching there for a time. He then took a job at the Central Committee of the Communist Party, the epicenter of Soviet power and ideology.

In a pivotal assignment from 1958 to 1961, Mr. Chernyaev worked in Prague on the staff of a journal, Problems of Peace and Socialism, where he was deeply affected by his contacts with reform-minded Soviet intellectuals as well as visiting Communists from Western Europe.

Image

A page from Mr. Chernyaev’s diary.Creditvia Svetlana Savranskaya

After returning to the Central Committee, he thrived, becoming deputy director of the international department in the early 1970s. While he never became anything like a dissident, Mr. Chernyaev privately formed a deeply critical perspective on the Soviet system.

“He was trying to do what good he could from within the system,” said Professor Taubman, who spent a decade talking regularly with Mr. Chernyaev for his Gorbachev biography.

Mr. Chernyaev was 65 and ready to retire when Mr. Gorbachev asked him to join his effort to remake foreign policy by bringing the Soviet Union closer to the West and scaling down the nuclear standoff that had lasted for decades. He agreed.

Mr. Gorbachev saw this campaign for “new thinking” in foreign affairs to run parallel with glasnost, his new policy of openness in the press, and perestroika, a reconstruction of the lumbering Soviet economy.

In his diary in 1986, Mr. Chernyaev expressed joy at the ascent of a Communist Party general secretary with new ideas.

“We’ve got a rare leader: a very smart man, educated, ‘alive,’ honest, with ideas and imagination,” he wrote. “And he is brave. Myths and taboos (including ideological prejudices) are nothing to him.”

He was at Mr. Gorbachev’s side at summit meetings with President Ronald Reagan and Prime Minister Margaret Thatcher of Britain; advised the Soviet leader on fending off Kremlin conservatives; and chided him in private (and in his diary) when he felt it was necessary.

When hard-liners seized power in Moscow in August 1991 and imprisoned Mr. Gorbachev in his vacation house on the Black Sea, Mr. Chernyaev, a guest there and a powerful swimmer, offered to smuggle out a note by swimming to a beach more than three miles away. Uncertain where he could take the note, they dropped the plan. The coup quickly failed in any case.

Mr. Chernyaev won many admirers abroad, including Rodric Braithwaite, the British ambassador to the Soviet Union and Russia from 1988 to 1991. In a tribute on Mr. Chernyaev’s 90th birthday, he wrote, “I was charmed to discover a man with a bristling mustache, the courteous look and air of a colonel of an English county regiment, twinkling eyes, a wicked sense of ironic humor and a gurgling chuckle, and a penetrating intelligence.”

Mr. Chernyaev was married for 47 years to the former Genya Vaynberg, who died in 2005. He is survived by their daughter, Anna Chernyaeva, and his partner, Lyudmila Rudakova.

He wrote six books and many articles, and in his later work he lamented the authoritarian and nationalist turn of the country under Mr. Putin and his aides.

A version of this article appears in print on , on Page A24 of the New York edition with the headline: Anatoly S. Chernyaev, 95, Gorbachev’s Vocal ‘Alter Ego’. Order Reprints | Today’s Paper | Subscribe