Syrian positions in this war-torn city appeared to be thinning out today as Damascus showed signs of following through on its threat to pull its peacekeeping troops out of the Lebanese capital.

The Syrian threat immediately raised fears of renewed clashes between rival militiamen and presented the feeble Lebanese Army with a major test of its ability to hold the country together.

Anxious residents of the capital began to withdraw their savings from banks and to stock up at stores and markets in anticipation of the violence they expect to erupt when and if Syrian troops make good on their vow to leave checkpoints and positions they have held in the city since they moved in to stop the 1975-76 Lebanese civil war.

Diplomats said, however, that the Syrians were unlikely to pull out of Beirut completely, but would probably retain key positions commanding the airport and the dividing line between East and West Beirut to enable them to intervene again quickly if needed.

The sudden decision to withdraw -- and the lack of any serious Syrian attempt to prepare the Lebanese Army to take over -- indicate to some observers here that Damascus was out to settle accounts for an accumulation of grievances with the Lebanese government.

Lebanese and foreign observers also speculated that, following a visit to Damascus last week by Soviet Foreign Minister Andrei Gromyko, the decision might have been coordinated to stir up some trouble here and thus divert attention from the Soviet invasion of Afghanistan.

In Washington, U.S. officials said the Syrian plan might be intended to provoke a crisis to draw attention to Syria and Palestinian cause and away from the Soviets' intervention in Kabul.

State Department spokesman Hodding Carter said today the United States hoped Syria would deploy its forces in a way that would strengthen the authority of the Lebanese government.

Syria let it be known over the weekend that it intended to withdraw its estimated 5,000 troops from Beirut immediately and regroup them in the Bekaa Valley east of the capital.

The news caught Lebanese officials by surprise and prompted a flurry of visits to Syria. Lebanese Prime Minister Selim Hoss petitioned the Syrians yesterday to put off the move indefinitely, but only succeeded in getting their agreement to postone it a few days.

"This is an operation to punish, not to be helpful," said a senior Western diplomat. He said that if the Syrians wanted to help the Lebanese government extend its control, they would make preparations to hand over positions to the Lebanese Army.

Instead, according to diplomatic sources, Syrian forces that have left positions on the Mediterranean coast south of Beirut in the last 10 days have turned them over to Palestinian guerrillas, including some leftist groups of the so-called Rejectionist Front. Most of the vacated positions have been taken over by the Syrian-controlled Palestine Liberation Army.

So far, Damascus has not fully explained the motives behind the withdrawal, but Syrian President Hafez Assad today indicated that accumulated frustrations were at least partly involved.

"We don't want to see our troops performing a policeman's role in the streets," Assad said after meeting with former Lebanese President Suleiman Franjieh, a Christian rightist leader. "We only want to be a deterrent force," he said adding, "We've been in Lebanon for four years and nothing has changed."

A Lebanese official said Assad's statement did not explain why the Syrians were raising these objections only now. "Obviously they are not on good terms with [Lebanese President Elias] Sarkis," he said.

In recent weeks Lebanon has defied Syrian tutelage by voting in the United Nations to condemn the Soviet invasion of Afghanistan and by attending the Islamic conference in Pakistan to discuss ways of countering the Soviet move. Syria, which is heavily dependent on Moscow for military supplies and assistance, abstained in the U.N. voting and declined to attend the Islamic conference.

The planned Syrian withdrawal from Beirut, diplomats said, also serves to remind the United States of the potential for conflagration here that could undermine the Camp David peace process, which the Syrians and other hard-line Arab states staunchly oppose.

More alarming to Lebanese, however, was a commentary on Damascus radio today intimating that the Syrian troops here, part of an estimated 22,000 in Lebanon, might turn over some of their positions in Beirut to Lebanese Moslem leftists and Palestinians.