MOSCOW, SEPT. 13 -- West Germany and the Soviet Union today initialed a 20-year friendship treaty, a document that is designed to create the basis for a new political and economic relationship between the two main European powers after decades of postwar animosity.

Today's friendship treaty and the agreement of the World War II allied powers Wednesday to restore sovereignty to a united Germany marked a historic reordering of Europe. West German Foreign Minister Hans-Dietrich Genscher said, "Now we can say with justification that the postwar period is over."

The Cold War friction between Bonn and Moscow was especially intense, but the document says that it is now of great importance "to finally be done with the past, and to use understanding and reconciliation to achieve an important contribution toward the overcoming of Europe's division."

The document, which is intended to allay Soviet fears of a new threat from a unified Germany, is to be signed soon by West German Chancellor Helmut Kohl and Soviet President Mikhail Gorbachev. A successful new relationship between Europe's two biggest powers could be the basis for long-range stability on the continent.

The treaty, the most comprehensive between the two countries since one brokered 20 years ago by former Bonn chancellor Willy Brandt, says that neither side will use force against the other and that both will "honor without reservation the territory of all European states in their current borders."

The treaty also says that "should one of the two sides be attacked {by a third nation}, the other side will make available no military help to the aggressor . . . and will introduce measures to settle the conflict through the use of the United Nations and other structures of collective security."

{In Washington, a spokesman for the West German Embassy said the new German-Soviet treaty would not conflict with Germany's NATO obligations, because it did not prevent Germany from aiding any other NATO state if it was attacked by the Soviet Union.

{Embassy spokesman Hans-Henning Horstmann added that signing and ratification of the friendship treaty are expected only after signing of similar nonaggression treaties among all the member nations of NATO and the Warsaw Pact later this year.}

The foreign ministers of the Soviet Union and Germany are to meet twice a year and the two countries are pledged to seek "binding, effective and verifiable agreements for significant reductions in armed forces and armaments, to attain a stable balance at low levels, especially in Europe, suitable for defense but not for attack."

Genscher, in his public statements here, has gone to great lengths to show Germans' contrition over the loss of more than 20 million lives in the Soviet Union during World War II. "We want nothing more than to live with all other people in peace and freedom and democracy," Genscher said.

In a letter accompanying the treaty returning sovereignty to Germany, the Germans pledged to the Soviets that they are dedicated to a future based on democracy and that they would protect Soviet war memorials and ban the National Socialist, or Nazi, movement.

"We are now dealing with a new Germany that has learned its history," said Soviet Foreign Minister Eduard Shevardnadze.

The friendship treaty calls for a rapid increase in trade between the two countries as well as technological exchanges. In the final stages of the negotiations with Moscow over the unification of Germany, which is to take effect on Oct. 3, Kohl pledged $7.6 billion to Moscow to help ease the costs of withdrawing 370,000 troops from East Germany over the next four years and then housing them in the Soviet Union.

West German Agriculture Minister Ignaz Kiechle has announced that Bonn also plans to send nearly $600 million in farm products and machinery to the Soviet Union to help with the country's deepening food crisis.

"This," Gorbachev said in a televised statement, "is cooperation between two great peoples." Gorbachev called the $7.6 billion sum "quite acceptable."

In the meantime, however, the Soviet news agency Tass announced that Bonn had denied an entry visa to the agency's newly appointed bureau chief in West Germany, Sergei Sosnovsky.

"Against the background of the warming up of relations between the two countries, the establishment of new ties and the renunciation of old stereotypes, the denial of a visa to a Soviet journalist representing a world news agency can only leave observers perplexed," Tass said in a commentary.

The West German Foreign Ministry told the Associated Press that it could neither confirm nor deny Tass's report.