President Reagan and Soviet leader Mikhail Gorbachev completed their Washington summit meeting yesterday with a mutual declaration of success after reaching an accommodation that sidesteps the crucial issue of limiting the U.S. Strategic Defense Initiative.

The two leaders' agreement to set aside the intense four-year-old dispute about Reagan's "Star Wars" was revealed in a joint written statement issued more than five hours after Reagan and Gorbachev said goodbye in a rainswept exchange of remarks on the White House South Lawn. Both leaders expressed the hope they can move on to a new agreement that could bring cuts of 50 percent in strategic, long-range nuclear weapons.

Reagan called the three-day summit, which fascinated Americans and Russians and attracted a global television audience, "a clear success." Gorbachev, responding in kind as aides shielded the two leaders with umbrellas from a downpour, said that "a good deal has been accomplished."

The two leaders finished the first superpower summit on U.S. soil in 14 years with characteristic flourishes. Gorbachev held a nearly two-hour news conference at the new Soviet Embassy compound on Mt. Alto on Wisconsin Avenue. Reagan ended the day with a nationally televised speech from the Oval Office in which he claimed the summit had made more progress to halt the arms buildup than any meeting since World War II.

In a joint statement, the two leaders said Gorbachev had renewed his invitation for Reagan to visit Moscow for their next summit in the first half of 1988 and that "the president accepted with pleasure." Reagan said in his address that he hoped they could continue in Moscow "what we achieved in these past three days."

The final day of the summit also brought a compromise agreement that the two nations would reduce their total strategic ballistic missile warheads to 4,900 each under the possible new arms-reduction treaty, ending a dispute over the precise ceilings in this category of nuclear weapons. The United States currently has about 8,000 such land-based and submarine-based warheads, and the Soviet Union has about 10,000 warheads.

The leaders also took another step toward a prospective strategic arms agreement, agreeing to establish a ceiling on the number of sea-launched cruise missiles and to seek a mutually acceptable way to verify that these limits are complied with. This agreement was the first U.S. acceptance of the principle of limiting such weapons, which the Soviets have insisted must be constrained in a future strategic arms accord.

Reagan and Gorbachev both expressed satisfaction with the progress made at the summit but said much more must be done to continue the momentum achieved with the signing Tuesday of the Intermediate-Range Nuclear Forces (INF) Treaty.

"The INF Treaty, as proud as we are of it, should be viewed as a beginning, not an end," the president said.

The most important accords, concerning strategic defense, were agreed to by the two leaders only minutes before they made their official farewells at 2:25 p.m. in a 20-minute departure ceremony at the diplomatic entrance of the White House.

Far from trumpeting their progress on the knotty issue of space defense, neither Reagan nor Gorbachev mentioned it in his departure statement from the White House and Reagan barely referred to it in his address to the nation last night. The striking reticence about the key result of the summit appeared to reflect the last-minute nature of the deal, which in effect is an agreement to disagree about this politically sensitive subject, which caused the previous Reagan-Gorbachev summit in Reykjavik last October to end in disarray.

Ignoring the gloomy weather as he said goodbye to Gorbachev, Reagan said, "This summit has lit the sky with hope for all people of goodwill. And as we leave, it is up to both sides to ensure that the luster does not wear off and to follow through on our commitments as we move forward to the next steps in improving the relations between our countries and peoples."

Gorbachev responded similarly. He called the INF Treaty "an unprecedented step in the history of the nuclear age" and said, "today the Soviet Union and the United States are closer to the common goal of strengthening international security."

Both leaders acknowledged that differences remained on regional and human rights issues, and that a timetable for withdrawal of the estimated 115,000 Soviet troops from Afghanistan, on which some U.S. officials had hoped for a breakthrough at the summit, had not been achieved.

But Gorbachev confirmed in a news conference held three hours after the departure ceremony that he officially put forward a proposal to withdraw Soviet forces from Afghanistan in 12 months, "maybe less."

The Soviet leader said, however, that "from the first day" a Soviet timetable for withdrawal is announced, the United States must agree to a "beginning of the end to arms and financial supplies to the insurgency forces" fighting the Soviet troops and the Soviet-sponsored government in Kabul.

Gorbachev said that if this happened, the Soviets would cease military operations on the day the timetable for troop withdrawal is announced.

A U.S. official said that Reagan, in his private discussions with Gorbachev, had stuck to the position that the Soviets should announce a timetable for troop withdrawal "without preconditions." The official called the results of the Afghanistan discussions "somewhat disappointing" but said it is still possible the Soviets would set down a withdrawal timetable within the next few months.

In his departure remarks Reagan said that he and the Soviet leader had "bluntly" expressed different views on Afghanistan and other regional wars, but had agreed "that it is necessary to search for real political solutions to these conflicts . . . . The door has been opened, and it will stay open to serious discussion of ending these regional conflicts."

One of the few areas where Gorbachev seemed to go out of his way to stress his differences on regional issues with Reagan was the Iran-Iraq war, now in its eighth year.

Gorbachev made it clear in his news conference that he does not yet believe the time has come for the U.N. Security Council to begin considering a resolution, which the United States strongly favors, imposing a U.N. embargo on Iran for refusing to accept an earlier resolution demanding a cease-fire.

"I think we have not yet exhausted the potential of the first resolution," he said.

Nonetheless, Gorbachev said discussions would continue with the United States over how to cooperate in bringing the war between the Persian Gulf neighbors to an end.

The most significant and potentially far-reaching advance of the Washington summit, concerning the meaning of the 1972 Antiballistic Missile (ABM) Treaty and future research and testing work on a space-based antimissile defense like Reagan's SDI program, came in the last hour of the three days of meetings, according to U.S. sources.

A working group on arms control issues, headed by U.S. arms adviser Paul H. Nitze and Soviet Marshal Sergei Akhromeyev, met in seclusion Tuesday afternoon, Wednesday morning, Wednesday afternoon and Wednesday night from 11 p.m. to 12:30 a.m.

Thursday morning at 8, Secretary of State George P. Shultz, accompanied by Nitze, met Soviet Foreign Minister Eduard Shevardnadze accompanied by Akhromeyev at the Soviet Embassy to review the state of the bargaining. It was decided then to brief the top leaders.

Shultz and Nitze went to the White House to see Reagan, while Shevardnadze and Akhromeyev conferred at the Soviet Embassy with Gorbachev. Because of these briefings and the last-minute negotiations, the morning session of the Reagan-Gorbachev talks, planned to begin at 10:30 a.m., did not get under way until noon.

The key arms control aides, however, met at the White House beginning about 10:30 a.m. in an effort to resolve some of the strategic-space arms issues, which both sides had publicly identified as the top priority for progress at the current summit. This group of five -- Nitze, Akhromeyev, U.S. arms negotiators Max M. Kampelman and Ronald Lehman and Soviet arms adviser Viktor Karpov -- worked until 1:30 p.m. while their superiors were having lunch in the Family Dining Room of the White House.

At this point, with the summit due to end with final departure statements at 2 p.m., Shultz and Shevardnadze, joined by Defense Secretary Frank C. Carlucci and national security adviser Colin L. Powell, excused themselves from the lunch to rejoin the arms control experts.

Much progress had been made on the questions of numerical limits on ballistic missiles, sea-launched cruise missiles and other questions. But the two sides were still not agreed on how to handle their conflicting interpretations of what is allowed to be done in the way of space-based testing and development under the ABM Treaty. This has been a crucial question and the cause of intense argument ever since Reagan proposed his SDI program in March 1983, and especially since the administration unveiled its new interpretation of the ABM Treaty in October 1985.

The final formulations were worked out by Shultz, Shevardnadze and the other high-level officials, working together with the arms control experts while the leaders and a few key aides finished their lunch.

While the departure statements were delayed for 25 minutes, the Soviet arms experts and Shevardnadze then briefed Gorbachev in the White House map room while Shultz and the U.S. arms experts were doing the same for Reagan in the White House library.

An administration official said that the departure statements were "deliberately on the bland side" because it was not known when they were being written how far the leaders and their arms experts would get in the final formulations.

The key accommodation is reflected in a paragraph of the joint statement saying that "the leaders of the two countries also instructed their delegations in Geneva to work out an agreement that would commit to observe the ABM Treaty, as signed in 1972, while conducting their research, development and testing as required, which are permitted by the ABM Treaty, and not to withdraw from the ABM Treaty for a specified period of time."

The Soviet Union continues to maintain that the ABM Treaty bans much research, testing and development of the Strategic Defense Initiative, while the Reagan administration continues to insist on a broad interpretation that would permit expanded SDI tests and development.

"The important point is that neither side is limited in terms of the testing, research and development they are permitted to do under the ABM Treaty as that side determines the ABM Treaty applies to them," said a senior White House official in a briefing on yesterday's accords. "In other words, nothing that was done today restrains U.S. or Soviet strategic defense research, development or testing efforts."

Gorbachev, asked to explain the Soviet position on this provision of the joint statement, repeatedly declined to do so at his news conference. He did acknowledge that he doesn't believe his meetings with Reagan this week made the expansion of the arms race into space any less likely. He added that stopping such a move "remains the goal of the Soviet Union."

The settlement which seems to have been reached on the SDI issue was foreshadowed last week by the comments in Washington of Soviet Foreign Ministry spokesman Gennadi Gerasimov. He said it was made more acceptable to the Soviet Union because Congress has passed and Reagan has signed into law a ban on using federal funds for any SDI tests that would violate a strict, or limited, interpretation of the 1972 ABM Treaty.

A senior U.S. official cautioned last night that "lots of work" remains to be done on various aspects of the strategic defense issue. But he said that the accord reached at the White House yesterday "takes the edge off" this contentious issue.

On the final day of the summit, Gorbachev continued to dazzle U.S. officials and ordinary Americans with a confident, whirlwind style reminiscent of an up-and-coming western politician. The Gorbachev motorcade stopped abruptly on Connecticut Avenue near L Street NW as the Soviet leader was en route to the White House for his final meeting with the president. Out popped Gorbachev to shake a few hands.

During the departure ceremony Gorbachev said that "in bidding farewell to America, I am looking forward to a new encounter with it in the hope that I will then be able . . . to meet face-to-face with its great people, to chat and to have some lively exchanges with ordinary Americans."

The rain-drenched audience on the South Lawn broke into spontaneous applause and Reagan, who has often expressed the hope that Gorbachev would be able to travel across the country and "see America," responded with a broad smile.

Gorbachev departed for the Soviet Union from Andrews Air Force Base at 9 p.m,. 76 hours after he arrived, with a scheduled stopover in East Berlin to brief Warsaw Pact leaders. Meanwhile, Shultz departed for Brussels and a briefing of North Atlantic Treaty Organization leaders.

Reagan finished the day with his nationally televised speech in which he contended that "persistence and consistency" in U.S. policy had paid dividends in the new agreement.

As a result of the summit, the editors of the Bulletin of the Atomic Scientists announced that the hands of the well-known "doomsday clock," which appears on the front cover of the magazine, will be adjusted backward to an extent yet undetermined in the next issue to reflect a lessened danger, because of the signing of the INF Treaty and "the great improvement in the Soviet-U.S. relationship overall." The magazine's symbolic clock, reflecting its estimate of the danger of nuclear annihilation, has been at three minutes to midnight for the past four years.

Staff writers David Hoffman, David B. Ottaway, David Remnick and R. Jeffrey Smith contributed to this report.