Soviet leader Mikhail Gorbachev today combined a sharp denunciation of the United States as "the forward edge of the war menace to mankind" with a renewed call for detente with Washington and a separate letter to President Reagan recalling the "spirit of cooperation" between the two countries in defeating Nazi Germany 40 years ago.

Speaking at a Kremlin rally marking the anniversary of that defeat, the 54-year-old Gorbachev blended anti-imperialist rhetoric, including a charge that Reagan's policies were "growing more bellicose" and had become "a constant negative factor" in international relations, with an assessment that there were still "realistic opportunities" for improved relations.

There was no clear or immediate assessment here of which message Gorbachev was more interested in getting across to Washington in his speech. But the strong language used in attacking the United States may have overshadowed, at least publicly, a generally cordial exchange of personal letters between Gorbachev and Reagan disclosed today in which both pledged to work harder for world peace and disarmament.

While describing, at the Kremlin rally, the present international situation as "complicated and even dangerous", Gorbachev said that "the course of events can be changed sharply if tangible success is achieved at the Soviet-American talks on space and nuclear arms" in Geneva.

The new Soviet leader, who was too young to take part in World War II, was interrupted 47 times by applause during his hour-long address.

Strong and sustained applause came on two occasions. First, when Gorbachev mentioned dictator Joseph Stalin as the architect of victory over Adolf Hitler, and again when Gorbachev reaffirmed his commitments to carry out major changes in the Soviet economy and society.

He was given a standing ovation by 6,000 party stalwarts and veterans who gathered at the Palace of Congresses for a six-hour-long fete.

In the late 1950s Nikita Khrushchev made Stalin a virtual non-person. Since Khrushchev's ouster in 1964, the name of the former dictator and wartime leader sometimes has been mentioned at World War II ceremonies. But Stalin was completely rehabilitated during the past year, and the strong applause at the mention of his name reflected Stalin's continued popularity among a section of the party, particularly among veterans who were most numerous in the hall.

Gorbachev talked in positive terms about the 1970s, calling East-West experiences then "priceless," because they provided "good political, legal and moral-psychological foundations" for cooperation between the two competing systems.

"We firmly believe that the process of detente should be revived," he said. "This does not mean, however, a simple return to what was achieved in the seventies. It is necessary to strive for something much greater.

"The Soviet Union is prepared to follow this path," he said. "The search for any opportunity for removing the danger of nuclear war should become the supreme duty of governments and responsible statesmen."

The conciliatory remarks in Gorbachev's speech came at the end of his address, a placement usually signifying a substantive message.

In his letter to Reagan, Gorbachev, according to the news agency Tass, said the "main lesson" of the war is that "a responsible approach to preserving peace and strengthening international security is required from all states and their leaders.

"The Soviet Union is prepared to cooperate with the United States to accomplish on this basis the task of preventing a nuclear catastrophe and fully eliminating nuclear weapons," Gorbachev said. The Americans, he added, may be assured that Moscow "will continue seeking this noble goal."

The Soviet leader also paid tribute to the military contributions in World War II of the United States, Britain and France. And, for the first time on such an occasion, the talk attempted a balanced assessment of contributions to the war effort made by Moscow's present allies.

But, he said, "We point out with pride that the outcome of the second world war was decided on the Soviet-German front."

Reagan, in his letter to the Soviet leader, said that the war "demonstrated that despite our differences we can join together in successful common efforts." The president said, "I would like our countries to join in rededication to the task of overcoming the differences and resolving problems between us."

Today's ceremonies were laden with symbolism. They were opened by Kremlin guards carrying the "victory flag," the standard that two Soviet soldiers planted on top of the Reichstag building when the Red Army took Berlin in May 1945.

Units from various services took part in the ceremonies, which are due to continue Thursday with a major Red Square military parade.

Shortly before the rally, western envoys, including the ambassadors of the United States, Britain, France and West Germany, laid wreaths at the tomb on the unknown soldier near the Kremlin wall. But U.S. Ambassador Arthur Hartman stayed away from the rally to protest the slaying in March of a U.S. Army officer by a Soviet guard in East Germany.

Much of Gorbachev's speech today was ideological, featuring the Soviet victory as a glorious test of the stability and tenacity of socialism in Russia. "The test of war," he said, "showed thus our socialist system is unconquerable and that its vital resources are inexhaustible." In recounting the history of the conflict, he noted that "peacetime is making its own rigorous demands" on society. Gorbachev said his program of reforms will put "to an exacting test the ability of society to ensure constant economic growth" and raise living standards.

Without mentioning Reagan, Gorbachev denounced the "aggressiveness of American imperialism," saying it was reflected in the desire of the U.S. "ruling elite" to break the existing military strategic balance between the two superpowers.

"We will not allow this balance to be broken. We shall continue to follow this policy because we have learned well, once and for all, what the past had taught us." The Soviet leader also accused Washington of being an "active participant in the reanimation of German revanchism," Soviet parlance for reunification of Germany.