The slow-motion war of extremist terror that for months has kept El Salvador hovering on the brink of revolution took a new and possibly decisive turn this weekend when the U.S.-backed junta and the seriously divided armed forces agreed to prosecute some of El Salvador's most powerful right-wing figures.

"We are hoping that this resolves a long simmering discord about who is in charge in the Salvadoran government," said one ranking U.S. official, "and now we can get on with the work of coping with the challenge from the ultraleft."

Supported and prodded by the United States, the Salvadoran government has implemented a number of sweeping economic reforms since the beginning of the year to earn popular support, undercut the demand of left-wing organizations and wrest power from the small, wealthy elite that has run El Salvador in its own interest for the last century.

But combined with the reform has been what appeared at least tacit acceptance of widespread oppression by some members of the Salvadoran armed forces allies with right-wing extremists.

Liberal government officials have been systematically assassinated or forced out of the country by these elements. Each day dozens of peasants are found murdered and mutilated. Human rights organizations count 1,500 people dead in political violence since the beginning of the year.

In the face of such brutality, growing members of Salvadorans, including relatively moderate Social Democrats and the more liberal wing of the Christian Democratic Party, have allied themselves with the leftist forces seeking to overthrow the current regime.

U.S. Ambassador to El Salvador Robert White has repeatedly and publicly prodded the Salvadoran government to move against right-wing extremists, but until about two weeks ago there was no sign of action.

Then the Salvadoran junta decreed that all tenant farmers and sharecroppers would henceforth own the land they worked. This took land away from about 5,000 owners and immediately put it in the hands of about 150,000 previously landless peasants.

In the wake of this reform, the well-funded and organized right began a campaign to force the most liberal military and civilian members of El Salvador's five-man junta to resign.

Robert d'Abuisson, a former Salvadoran intelligence officer forced to retire in October when liberal elements of the Salvadoran armed forces took over the government, distributed a videotape to Army barracks throughout the country claiming that two members of the junta, Col. Adolfo Majano and Christian Democrat Jose Antonio Morales Erlich, are communists. D'Abuisson, who in recent weeks has talked with congressional and administration figures in Washington, called for their resignation and replacement by members of his Broad National Front.

Several military commanders at first sided with D'Abuisson, but after days of tense negotiations, the junta was able to withstand his challenge. Last week, Majano used his most loyal military unit to arrest D'Abuisson and almost 30 fellow conspirators.

A suitcase full of incriminating documents was reportedly found in their possession, and many of the people arrested are believed to have direct involvement with the right-wing death squads responsible for much of El Salvador's most brutal violence.

Over the weekend, meetings were again held with all ranking officers in Salvador's military establishment to determine whether they would support the junta or D'Abuisson. The Christian Democrats, meanwhile, threatened to resign from the government if D'Abuisson were freed.

[A military judge freed D'Abuisson late Tuesday night, saying the charges against him were without merit, the Associated Press quoted a military official as saying. The leader of the Christian Democrats said afterward that his party did not plan to quit the party "at the moment."]

A crucial concern of several military commanders was that active duty officers arrested along with D'Abuisson be immune from prosecution. According to well-informed sources, a compromise has been reached in which D'Abuisson's civilian conspirators will be tried while the active duty officers will be transferred to new posts without prosecution.

Meanwhile, members of Salvador's wealthy oligarchy who are sympathetic to D'Abuisson, have turned with increasing hostility against the United States and its ambassador. Angry crowds of well-dressed Salvadorans demonstrated in front of White's residence here over the weekend threatening to hold him hostage until D'Abuisson was released.

White finally broke out of his residence with U.S. Marine guards in a cloud of tear gas Monday morning. But unidentified gunmen sprayed heavy calibre bullets and threw two bombs into the U.S. Embassy later in the day. There were no injuries.

Despite both the physical and political dangers involved, the United States has committed itself to support of El Salvador's government in hopes that a middle-of-the-road solution can be found somewhere between what it sees as political extremes.