The left's shift of tactics with an attack on U.S. marines and other restaurant diners earlier this month has illustrated the difficulties here that still face President Jose Napoleon Duarte and U.S. policy makers.

This spring, Duarte, the U.S. administration and many commentators were lauding progress in the armed forces' military and human rights performance and in the building of a political center independent of extremist forces of the left and right.

Duarte has restrained the far right within the armed forces and defeated it at the polls only to find that the extremist left has upped the ante in the five-year-old civil war.

The leftist rebels are strong enough to keep the government off balance but too weak to gain the upper hand overall, according to Salvadoran and U.S. officials and other political observers.

A drawn-out conflict seems likely, and both Archbishop Arturo Rivera y Damas and chief government spokesman Julio Rey Prendes said that El Salvador might face what they called "Lebanonization."

The immediate effect of the June 19 attack on the restaurants was to disturb this capital, which had grown blase in recent years about the war in the mountains.

Business dropped sharply in the "Pink Zone," the cluster of 14 restaurants where the attack took place. This slice of Georgetown has sprouted in the past two years just 25 miles south of Guazapa Volcano, site of frequent rebel skirmishes and aerial bombardments.

On the policy side, the Salvadoran and U.S. governments cited the restaurant attack in renewing past calls for expanded U.S. assistance to El Salvador's security forces.

These forces currently face congressional limitations on receiving U.S. aid because they are police organizations. But it was widely acknowledged that it is difficult to prevent terrorist attacks regardless of who gets additional training, vehicles or automatic weapons.

The simplest and most direct response to the attack was the U.S. Embassy's reaffirmation of guidelines urging personnel not to visit restaurants or other public places on a predictable basis. The assassinated marines, who were guards at the fortress-like U.S. Embassy here, had visited Chili's sidewalk hamburger cafe many times before the attack there.

The attack, acknowledged by the leadership of the Farabundo Marti National Liberation Front or FMLN, simultaneously highlighted both the range of the left's weapons and its weakness in having to resort to terrorism, officials and other observers said.

After gunning down the unarmed, off-duty marines, commandos picked civilian diners to kill or wound in the legs. They appear to have shown a preference for prosperous-looking persons of fair complexion, and the FMLN said it had attacked a "garden of the rich."

The FMLN, mostly a rural guerrilla army of roughly 6,000 to 7,000 combatants, was almost apologetic about having employed such deliberate brutality.

"We reiterate our decision to combat the Yankee invaders, and, in doing so, to make use of all resources within our reach in a popular war," the FMLN's General Command said in a communique.

The guerrilla leadership disputed a statement by Duarte that it had sent him death threats, but it did so in a double-edged way.

"We say that we did not threaten to kill Mr. Duarte, but we remind him that he is commander-in-chief of the Army, with which we are at war," said the communique signed by commanders of the five guerrilla forces in the front.

The apparent new emphasis on terrorist tactics showed signs of alienating some of the guerrillas' allies and sympathizers here and abroad. The Popular Social Christian Movement, one of several small leftist political parties allied with the guerrillas, formally condemned the "terrorist killings" in a statement published in a Salvadoran newspaper. It did not specifically mention the FMLN.

The Popular Social Christian Movement is linked to prominent leftist political spokesman Ruben Zamora, who was one of the left's two civilian delegates to the La Palma peace negotiations with Duarte last Oct. 15. The movement also is part of the Democratic Revolutionary Front, the umbrella group of left-wing parties allied with the guerrillas.

The rebels' apparent new emphasis on terrorism and urban agitation in part represents a strategic retreat from the countryside in response to military gains there by the armed forces, officials and other observers said. The Marti front got its start with a wave of political killings and kidnapings in the late 1970s, but it moved most of its forces to mountains and swamps in the north and east in the early 1980s.

The leftist forces moved to the countryside largely to escape the assassinations of their supporters spearheaded by the three military security forces: National Police, Treasury Police and National Guard. The guerrilla front expanded its zones of control in the east during an autumn 1983 offensive, which now appears to have marked the high point in the left's military fortunes in the countryside.

Since early 1984, the government has recovered militarily and has bottled up the guerrilla fighters in enclaves in sparsely populated and frequently bombed areas. The government has gained prestige with human rights reforms, and with victories over the political far right by Duarte's Christian Democrats in the 1984 presidential elections and in legislative and municipal votes in March.

Now the FMLN is continuing small-unit guerrilla raids in the countryside, regularly declaring nationwide "vehicle stoppages" and laying more mines. But its most dramatic shifts in policy have been in stepping up use of terrorist tactics and violence against civilians.

For several months in the spring and summer of last year, the guerrillas tried to recoup battlefield losses with forced recruitment of hundreds of youths. In addition, the left has stepped up political assassinations and kidnapings in the past year, hitting mayors and other local officials, former military officers and even a factory foreman.

Several Salvadorans said in brief street interviews that the left was seeking to kindle a violent rightist backlash of the sort that already has claimed tens of thousands of lives.

"It breaks my heart in pieces to see this. They want to encourage those who respond to such things," a woman who works for the Interior Ministry said.