GENEVA, NOV. 24 -- The United States and the Soviet Union reached agreement here today on the final terms of a treaty to eliminate U.S. and Soviet medium-range and shorter-range nuclear missiles and banning their future production, Secretary of State George P. Shultz and Soviet Foreign Minister Eduard Shevardnadze announced after a final bargaining session.

Minutes after resolution of the final disagreement -- about designation of a U.S. missile-production plant where several dozen Soviet inspectors will be allowed to be in residence for 13 years -- Shultz and Shevardnadze appeared before reporters and photographers with a symbolic handshake of agreement on the complex and precedent-setting pact.

The treaty, which would eliminate all U.S. and Soviet land-based missiles with ranges between 300 and 3,400 miles, would provide the most intrusive inspection of the rival superpowers' missile facilities and production plants in the roughly 20-year history of arms-control negotiations.

Shultz called the treaty "a good beginning" that will bring about for the first time in the nuclear era major reductions in atomic weapons rather than simply place limits on future weapons growth.

He also noted that, when ratified by the Senate, the accord will end a turbulent eight-year struggle fought out mainly in Western Europe. That struggle saw the United States and its North Atlantic Treaty Organization allies attempting to match new Soviet missiles by bringing in new U.S. missiles, or getting the Soviets to agree to participate in a withdrawal of all missiles of this category by both sides.

Referring to the long and bitter history of nuclear missile deployment, which began with Soviet deployment of modernized, triple-warhead SS20 medium-range missiles aimed at Western Europe and Asia in 1977, Shevardnadze declared that "the marathon is over" due to "an intellectual breakthrough" at last October's U.S.-Soviet summit in Reykjavik, Iceland, and to "difficult and complicated negotiations."

Shevardnadze said the accord leaves no doubt that the Dec. 8-10 Washington summit of President Reagan and Soviet leader Mikhail Gorbachev, in which the treaty is to be formally signed, will be successful and that "the next step will be made toward the abolition of nuclear weapons."

In separate news conferences, the two foreign ministers emphasized the novel features of the treaty, which is now complete except for the drafting of legal language in a document that, with annexes and protocols, will run to about 200 pages of finely crafted text.

Shultz noted that the reductions will be much greater for the Soviet Union, which must eliminate about 1,500 deployed nuclear warheads, than for the United States, which is to eliminate about 364 deployed warheads on Pershing II and cruise missiles, both of which carry single warheads.

This "asymmetrical" result, which Shultz described as "an important principle," was justified by the much greater number of medium-range and shorter-range missiles deployed by the Soviets. Greater Soviet than U.S. reductions are also expected in a follow-up long-range strategic arms agreement, which was discussed by Shultz and Shevardnadze today and which is expected to be the central issue for negotiation at the Washington summit.

Shultz said "some progress" was made today toward agreements on strategic arms to be negotiated in Washington and that some additional work by the two sides in this field may take place before the summit. Shultz said he and Shevardnadze also discussed Afghanistan and the Persian Gulf but had no progress to report.

Shultz outlined in unsual detail the extensive provisions for monitoring of complicance with the treaty, calling them "far beyond anything that's ever been attempted before."

Among the verification provisions he outlined are: U.S. inspection for 13 years of the exits and perimeter of a site at Votkinsk, in the eastern Soviet Union, where henceforth-banned SS20 missiles were assembled and where look-alike SS25 missiles continue to be put togther. There will be comparable Soviet inspection of a U.S. missile-production plant whose location Shultz would not reveal.

A U.S. aide said about 30 to 40 inspectors on each side would be on location 24 hours a day to make sure no banned weapons are produced. An elaborate array of inspection rights by individuals and by an unusual uncover-the-site arrangement -- so that the sites will be visible to cameras on spy satellites -- at hundreds of locations in the Soviet Union and Eastern Europe where the prohibited missiles are or have been based. A similar arrangement will cover the smaller number of U.S. medium-range nuclear facilities in Western Europe and the United States.

U.S. inspectors will be able to enter the Soviet Union via Moscow or Irkutsk, and Soviet inspectors will enter the United States via Washington or San Francisco, without saying in advance which area they want to inspect. The side being inspected is committed to provide transportation within a few hours to the challenged area, where the inspectors could compare what they find with maps, diagrams and other detailed information to be exchanged in advance.

Twenty such short-notice, on-site inspections per year are permitted to both sides in the three years after treaty ratification, as the banned missiles are being eliminated. Fifteen inspections per year are allowed over the following five years and 10 per year in the subsequent five-year period.

{Defense Secretary Frank C. Carlucci, in his first day on the job as Pentagon chief, endorsed the treaty agreement Tuesday. He said verification rights granting Soviets access to U.S. military facilities "can be done without compromise to our national security," Washington Post staff writer Molly Moore reported.

{"And for the first time in history we will have people on-site in the Soviet Union looking at missiles as they come out of the final assembly facility," said Carlucci. "For those of us who have been around for awhile, that's pretty mind boggling."}

The United States is arranging with Britain, Belgium, Italy, the Netherlands and West Germany, where its medium-range weapons have been located, to exchange diplomatic notes with the Soviets to permit inspections on the territory of those countries. The Soviet Union is arranging for similar U.S. agreements with Czechoslovakia and East Germany.

While the treaty will ban present and future medium-range and shorter-range ballistic missiles and ground-launched cruise missiles, a clause to prevent circumvention has been worded so that, according to U.S. officials, it will not interfere with the deployment of weapons not covered, such as nuclear-armed aircraft and other types of cruise missiles, which NATO is considering adding to its arsenal as a modernization measure.

One aspect of the negotiation still unfinished is the Soviet transmission of detailed data on the location of all of the nuclear launchers and warheads to be eliminated under the pact. Most of the information has been provided, U.S. officials said, but specific data on the location of some undeployed weapons is still to come. Shultz said it was promised by the end of this week.

U.S. officials disclosed that the elimination of shorter-range Soviet missiles in East Germany and Czechoslovakia will be quicker than U.S. negotiators had expected. The warheads will be sent to a disposal plant within 90 days after the pact takes effect, and the launcher, or missile, will be sent to a separate disposal area within the same period.

The destruction of the missiles or their launching into a designated impact area is to be monitored closely. The nuclear material in the weapons may be recycled for use in other bombs or missiles not covered by the pact.

Some of the final compromises were crafted by working groups headed on the U.S. side by Paul Nitze, who has been deeply involved in the negotiations from the start, and by Soviet Marshal Sergei Akhromeyev, who U.S. officials said was crucial to last-minute Soviet decision making. At one point, Shevardnadze called Akhromeyev "the most peaceful chief of the general staff in the world."