In signing the treaty to eliminate medium- and shorter-range missiles yesterday, President Reagan and Soviet leader Mikhail Gorbachev set in motion a complex series of steps that will lead to the destruction of 2,611 nuclear weapons.

It is the first time in history that two nations have mutually agreed to destroy an entire class of nuclear weapons, and the language of the treaty text, which was officially declassified yesterday, underscores the significance of what U.S. and Soviet negotiators accomplished.

The treaty states at the beginning that both nations are: "conscious that nuclear war would have devastating consequences for all mankind . . . {and} convinced that the measures set forth in this treaty will help to reduce the risk of outbreak of war and strengthen international peace and security." And then in a succinct sentence, the treaty sums up six years of negotiations with a simple pledge that "each party shall eliminate its intermediate-range and shorter-range missiles {and} not have such systems thereafter . . . . "

Reagan and Gorbachev signed separate sets of official documents, each about 4 1/2 inches high. The documents were a 41-page treaty, two protocols and one appendix; they spell out detailed procedures for exploding, burning, crushing, flattening, or harmlessly launching all Intermediate-Range Nuclear Forces (INF) within three years.

In one of the treaty's novel features, most of these actions will be closely inspected by the other side.

Three of the four documents were released to Congress and the public yesterday, marking the start of the administration's campaign to win public support and ratification of the treaty by the Senate next spring.

But the fourth document, providing an extraordinary glimpse of exactly where U.S. and Soviet missiles are located and how many there are, remained classified last night, and U.S. officials would say little about its contents.

This surprising turn of events resulted from a Defense Department demand that the information be withheld to avoid potential terrorist attacks on the U.S. and allied nuclear weapons bases identified in the report, according to a senior Pentagon official.

Senior State Department officials said, however, that they were not persuaded that the information could reasonably be withheld, and predicted the decision could be overturned by the White House today.

"It is an issue that is under consideration within the administration," Maynard W. Glitman, the chief U.S. negotiator on the INF treaty, said at a press briefing yesterday afternoon. "I really cannot say more on that subject."

Soviet arms negotiator Alexei Obukhov, who spoke a few moments later, expressed surprise when reporters informed him of the U.S. decision.

"Our impression during the talks was that the U.S. side was in favor of publication," Obukhov said, adding that neither side had discussed potential terrorist incidents.

"I never thought that there was a problem of this sort," he said.

Soviet Foreign Ministry spokesman Gennadi Gerasimov said that, regardless of the U.S. decision, the document would eventually be published in the Soviet Union.

According to the treaty text, all U.S. Pershing IA, Pershing II and ground-launched cruise missiles will be destroyed within three years, as will all Soviet SS4, SS5, SS12, SS20 and SS23 missiles. An experimental new Soviet cruise missile and an experimental new U.S. Pershing missile, the 1B, will also be destroyed.

Neither Glitman nor Obukhov would say exactly how many missiles of each type are to be destroyed under the treaty.

They also declined to disclose the number of sites in each country that could be subjected to on-site inspection by the other side, prompting some U.S. officials to speculate that these issues were not fully resolved even though Reagan and Gorbachev had already signed the treaty.

The two negotiators instead provided more general information that the treaty will eliminate 926 shorter-range Soviet missiles, 387 of which are currently deployed at missile bases in Eastern Europe and the Soviet Union, and 170 shorter-range U.S. missiles, which are all in storage in the United States.

The treaty will also eliminate 826 medium-range Soviet missiles, 470 of which are at missile bases in the Soviet Union, and 689 U.S. medium-range missiles, 429 of which are at missile bases in Western Europe.

A treaty protocol requires that the missiles be destroyed at designated sites. Each side may destroy up to 100 medium-range missiles within the first six months by launching them from existing missile test ranges. Before any missile can be moved to a new location, each side must notify the other 30 days in advance.

The treaty also allows both sides to conduct dozens of on-site inspections each year, and to station inspectors outside former production plants for the Soviet SS20 and the U.S. Pershing II for 13 years.

Although most of the treaty details were settled by Sunday, several were resolved Monday morning in Geneva before Glitman and Obukhov flew to Washington.

"We had the great majority of the treaty done, except for one or two issues, and . . . wrestled them to the ground in the last couple of days," Glitman said.

Officials said Glitman and Obukhov spent much of the flight writing their initials on the margin of the final treaty text, which was reviewed en route by the general counsel for the Arms Control and Disarmament Agency, Thomas Graham Jr. Senior State Department and White House officials reviewed it later.

The treaty text was printed late Monday night and early yesterday morning.