MOSCOW, NOV. 22 -- In the end, Margaret Thatcher, the steely cold warrior and free-market rebel, was celebrated as a hero above all in the land of the Bolsheviks.

After learning today that Thatcher would resign as prime minister, many West European leaders who had grown frustrated with her reluctance to accelerate the process of European integration could scarcely conceal their relief behind a diplomatic guise of discretion and respect. In the Soviet Union, however, the reaction was one of surprise and regret.

During a decade when the country turned away from doctrinaire communism, many Soviets in the 1980s came to admire, and often idealize, Thatcher and Ronald Reagan as the firm, unapologetic symbols of Western strength, liberty and prosperity. The Soviet Union itself has grown so inward-looking, so engrossed in its own interwoven economic and ethnic difficulties in recent months, that even high-ranking officials were thrown off guard by the announcement from London.

"It was a surprise," said Gennadi Gerasimov, the former government spokesman who is about to take on a new assignment as Soviet ambassador in Lisbon. "In our imagination she was the Iron Lady who would fight to the end. We will remember her as someone who made a great contribution to the good relations between the Soviet Union and the Continent."

Thatcher, Gerasimov said, "was a historic figure who helped bring the Soviet Union closer to Europe."

Legislators in the their thirties who espouse free-market economics, such as Ilya Zaslavskaya and Arkady Murashev, often said that without Thatcher and Reagan, the Soviet Union might never have felt sufficient external pressure to begin its revolutionary internal reforms. Among intellectuals here, Thatcher had an even higher standing than Reagan because of her ability to match, and clash with, the new generation of Soviet leaders on an intellectual level.

Six years ago, when he was second-in-command and Soviet leader Konstantin Chernenko was dying in Moscow, Gorbachev decided to go to England and begin reshaping the Kremlin's relations with the West using the unlikely conduit of the ultimate Tory, Thatcher. Although her hard-line anti-communism was well-known, she seemed utterly enchanted by Gorbachev, both as a personality and as a reformer.

"I have never talked to any other Soviet leader like him," she told reporters after a 3 1/2-hour session with Gorbachev. "I like Mr. Gorbachev. I think we can do business together."

Thatcher's "endorsement" of Gorbachev not only was critical to his eventual acceptance in the West, especially by President Reagan, but also gave him a crucial boost during the struggle for power after Chernenko's death in March 1985.

Because of Thatcher's often truculent resistance to joining the process of European integration, the reaction today in France, Germany and the rest of the continent to her resignation ranged from guarded to celebratory.

A French Foreign Ministry official said that French leaders were reluctant to rejoice openly on the European issue because their immediate concern was to maintain a united front in the international coalition against Iraq. "Everyone is happy, but we're in a delicate situation. With what's going on far away, we can't be too enthusiastic," the official said.

European Commission President Jacques Delors, one of Thatcher's sharpest opponents on the issue of European integration, told the French press agency that he had the "highest esteem" for Thatcher despite their political differences.

But European Community officials in Brussels privately said that practically any of Thatcher's potential successors would be more amenable to European economic integration, especially on issues such as a unified European currency and monetary policy.

Pierre Mauroy, head of the ruling Socialist Party in France, said that Thatcher's fall was the result of her conservative economic policies, which he said led to the decline of British industry and heightened social tensions.

In Germany, the reaction was also ambivalent. A year ago, German Chancellor Helmut Kohl would have taken Thatcher's demise as the loss of an ideological soulmate. Today, Kohl met the news with silence.

Handed a bulletin as he sat in parliament this morning, Kohl showed no emotion. Later, he declined to make any statement. With Thatcher gone and Reagan retired, Kohl is the sole survivor of the conservative triumvirate that dominated the West in the 1980s.

But there was little sadness in Bonn. In the past year, German-British relations have deteriorated to perhaps their worst level since the end of World War II. The Germans reacted angrily as Thatcher resisted Kohl's notion of an integrated Europe and objected when she insisted on modernizing short-range missiles stationed in what was then West German territory.

But Thatcher put the greatest strain on the relationship when she, at first, opposed the idea of German reunification and then, when it became inevitable, continued to express deep concern about mounting German economic and political power.

Thatcher often caused offense in Germany with blunt remarks about Germany's guilt in the last world war and with her reluctance to allow Bonn to accumulate more power. Last spring, she told a German diplomat, "You will need another 40 years before we forget what you have done."

After reunification, Thatcher did not so much congratulate the Germans as warn them: "It will be up to the rest of us to see that Germany does not dominate. Others of us have powerful voices."

The parliamentary floor leader of Kohl's Christian Democratic party, Alfred Dregger, thanked Thatcher for fighting for democracy but said she had "tragically refused to recognize the European awakening."

The leader of the opposition Social Democrats, Hans-Jochen Vogel, put it more strongly, calling her resignation "a great encouragement" to European unification and a sign that "the reckless lust for profit" would not prevail on the continent.

Belgian Foreign Minister Wilfried Martens said Thatcher "finally had to realize that in public opinion, and certainly in her own party, people want to be part of a European Community that is much more integrated than it is today."Correspondent Marc Fisher in Bonn and special correspondent Sharon Waxman in Paris contributed to this report.