BUENOS AIRES, JUNE 5 -- Hoping to quell unrest in the armed forces, Argentine legislators gave final approval early today to a law protecting many, though not all, officers from prosecution for most atrocities committed in the 1970s war on leftist subversion.

Government officials regarded the action as the start of a new, more constructive phase in troubled civilian-military relations. But it disappointed military officials as much as it angered human rights activists, leaving analysts predicting further confrontations.

The law was prompted by officer rebellions in April that nearly plunged the country into civil war. Government officials have insisted that President Raul Alfonsin made no deal with Army rebels to win their peaceful surrender Easter Sunday. But fears of new mutinies helped propel the legislation through Congress.

Many here worry that military hard-liners, having seen what concessions can be wrung by armed rebellion, will continue to threaten the peace until the government recognizes the legitimacy of the antiguerrilla campaign and grants a formal amnesty canceling all planned trials of officers accused of murder, torture and illegal arrests during the campaign.

"What the armed forces want, aside from immunity, is for it to be said that the fight against subversion was well done and should be rewarded with medals," said Julio Cesar Strassera, the prosecutor who has handled the only two cases judged so far in Buenos Aires. "The only thing we're lacking is for a monument to be erected tomorrow -- with, instead of a sword, an electric cattle prod."

Since the military revolts, the government has been criticized for having had no clear or comprehensive military policy in the 3 1/2 years since Alfonsin was elected.

Alfonsin, who has done little to modernize the armed forces, removed two dozen generals at the start of his administration and halved the defense budget (from 4.2 percent of the gross national product to 2.2 percent). The services have continued to quarrel with each other over facilities and equipment and with civilian authorities who want to redefine the military's mission to exclude any internal security role.

"The government has not had a military policy, just a human rights policy directed at the military," said a lawyer with ties to both the military and the government.

Now even that policy, which marked the first attempt by a civilian government in South America to put former military rulers on trial, has fizzled.

The new legislation leaves only a limited group of retired senior officers liable for prosecution for crimes during the antiguerrilla campaign. Other military, police and penitentiary officials, at or below the Army rank of brigadier general or the equivalent, are shielded from trial on the grounds they acted under "due obedience" to orders.

About 250 military officers and another 100 to 150 police and penitentiary personnel had been expected to face trial for such crimes. Federal courts now have 30 days to determine which high-ranking officers will be prosecuted.

The remaining cases could, it is feared, spark fresh revolts or a constitutional crisis if officers summoned to testify refuse to appear in the civilian courts hearing the charges.

Adding to lingering tensions is the uncertain fate of the middle-ranking officers who led the main uprising at the Army's Campo de Mayo base in Buenos Aires province. The rebels had understood from Alfonsin that a military tribunal would try them for mutiny. But a civilian judge is pressing a charge of "attempted rebellion" in a federal court.

In its original form, which passed the lower house last month, the new law had been intended to benefit only officers from the rank of lieutenant colonel down. But military officials demanded the legislation be extended to higher-ranking officers. Alfonsin conceded, and it was broadened last week in the Senate to cover senior officers who were not chiefly responsible for issuing orders or preparing plans in the antiguerrilla campaign.

Nearly all legislators belonging to Alfonsin's Radical Civic Union fell into line behind their back-pedaling president, many of them reluctantly. After more than seven hours of debate, the Chamber of Deputies, which the Radicals control, passed the measure 125-54 at 1:30 a.m. today.