It was Feb. 23, the day after at least 18 peasants were slaughtered on a rural river bank and a month after the Reagan administration last certified that El Salvador's Army was making progress in protecting human rights.

Gen. Jose Guillermo Garcia, who was defense minister at the time and whose soldiers had been accused of the massacre, made a public pledge that a full investigation would be launched and justice would be done for the mostly Indian families whose men had been trussed up and shot in the head at a place called Las Hojas near the provincial capital of Sonsonate.

Now, after 4 1/2 months of inquiry by the Army, the government Human Rights Commission and the public prosecutor's office, the first man has been put behind bars. He is Fermin Garcia Guardado, who himself was nearly dragged off to the river bank, whose son was among the victims and who is treasurer of the Indian organization to which Gen. Garcia made his promise.

The story of how Garcia Guardado ended up in Sonsonate's Penal Center charged with attempted homicide while the soldiers accused of carrying out the massacre remain free goes a long way to illustrate the problems of El Salvador's judicial system. Although it has attracted less U.S. attention than attempts to prosecute the killers of two American land reform advisers and four American churchwomen, it dramatizes the difficulties in protecting human rights in a country whose Army often operates outside what in the United States is considered normal civilian authority.

"We know very well what happened, the massacre," said Cristobal Aleman, a member of the seven-member government Human Rights Commission who tried to investigate the killings. "But the problem is the political chaos we are living in in this country."

Aleman, 21, has started carrying a nickel-plated .357 revolver in his belt, lest he become a victim of the chaos. He said this is because he noticed armed men in civilian dress following him in an unmarked car after he went out to Las Hojas and, seeing blood in the dirt and viewing 18 bodies, proclaimed that a massacre had taken place.

Based on Aleman's interviews with witnesses, the commission last April addressed a report on the Las Hojas killings to President Alvaro Magana, the Defense Ministry and the public prosecutor's office here in the capital. The report relayed peasants' accounts that three truckloads of soldiers from the Sonsonate detachment of Col. Elmer Gonzalez Araujo carried out the killings after members of the local paramilitary Civil Defense unit, some of them masked, pointed out the Indian men to be taken away as "subversives."

Adrian Esquino, head of the Sonsonate-based National Association of Salvadoran Indians, said in an interview that guerrilla slogans had been painted on walls on the outskirts of Sonsonate two weeks earlier, but that the Indian peasants had nothing to do with them. The real problem, he added, was a dispute over land purchased by the association and farmed as a cooperative to the irritation of those who acted as informers for the Army the morning of the slaughter.

Esquino said that after hearing of the early-morning killings, he went to Col. Gonzalez at the Sonsonate garrison, only to be told nothing had happened. After visiting Las Hojas two miles away and seeing the bodies, Esquino said, he went back to Gonzalez and saw three truckloads of soldiers returning to the garrison under the command of Capt. Salvador Figueroa Morales. But Gonzalez dismissed him again, he said.

So he and Garcia Guardado traveled to San Salvador the next day and obtained the promise of justice from the then defense minister, Gen. Garcia, who has been cited by U.S. officials as one of the Salvadoran officers most aware of the need to meet U.S. human rights requirements to continue receiving U.S. military aid vital for pursuit of the war against leftist guerrillas.

On April 11, six weeks later, the Defense Ministry announced that Figueroa Morales had been confined to his garrison pending an investigation into allegations that he commanded troops who carried out a massacre. That was the same day Esquino and Garcia Guardado began a week of meetings in Washington urging congressmen to pressure the Salvadoran government into punishing the soldiers who they charged had murdered as many as 74 peasants.

The U.S. Embassy here, meanwhile, had pulled out U.S. military advisers who were training Salvadoran soldiers in Sonsonate at the time of the killings. Ambassador Deane R. Hinton forbade further contact with Gonzalez or his unit, knowledgeable sources said.

At the same time, Esquino's group brought a suit against those who it said had falsely accused the massacre victims of being "subversives," the common Army word for leftist guerrillas. Gonzalez accused the group of trying to sue "the Salvadoran people," Esquino said, warned that "harm" would come to its members unless they withdrew it and complained that they had sullied El Salvador's name during the Washington meetings.

Esquino said the threat was made in a May 25 meeting of the association's executive committee, including Garcia Guardado, with Gonzalez and Defense Minister Eugenio Vides Casanova, who had taken over from Gen. Garcia in April.

Vides Casanova, seated at the table in Gonzalez's Sonsonate office, "calmed down" the colonel, Esquino said, and renewed the pledge made earlier by Gen. Garcia to see that justice is done.

That was where matters stood until June 24, when members of the National Police burst into the Indian group's offices and arrested Garcia Guardado, charging that he had shot and wounded Juan Arquelinos Sermeno on March 28 in an attempt to kill him. Esquino said the charges are false and Garcia Guardado was with him in the association's office at the time of the shooting.

Arquelinos Sermeno was one of the men who had pointed out Indian "subversives" on the morning of Feb. 22, Esquino said. He also was one of those cited in the association's suit. Witnesses accusing Garcia Guardado of trying to kill Arquelinos Sermeno include his brother, a cousin and a close friend--all of whom, according to Esquino, also were among the Army's informants the day of the massacre and are named in the suit.

"The day of the massacre, they were all there, pointing people out," Esquino said. "It is always the same ones."

Gonzalez, meanwhile, has passed word to the association that Figueroa Morales is not being detained after all because he is an "excellent" officer and has been transferred instead to Morazan Department at the other end of the country, Esquino said. A telephone operator at the Sonsonate garrison confirmed that Figueroa Morales was no longer there because he had gone to Morazan.

The Defense Ministry here, queried repeatedly over three days, said it was a "delicate matter" that would be checked.

"Col. Gonzalez wants those who caused it the massacre to remain free, and those who suffered from it to become prisoners," Aleman said. Attempts to reach Gonzalez at his garrison in Sonsonate and by telephone were unsuccessful. He was posted to the area, generally considered one of the least troubled by guerrillas, at the beginning of the year after a stint as military chief of staff in Magana's presidential palace.

U.S. advisers and Salvadoran officers have described him in private talks with reporters as one of the country's least able commanders. He was assigned to Magana's staff, they say, after nearly losing control of the town of Usulutan on election day last year.

"As long as he is here, we are going to have problems," said Esquino. In the office of his 15,000-member association hung a photograph showing Sen. Edward M. Kennedy (D-Mass.) with his arm around him, a souvenir of the trip to Washington.

"Your cry for justice will be heard," read an inscription on the photograph.