The slaying Saturday of land reform director Rodolfo Viera has removed one of the few remaining figures in El Salvador's teetering government with any claim to popular support or contact with the country's vast majority of poor peasant farmers.

Salvadoran President Jose Napoleon Duarte has said he believes extreme rightists killed Viera, along with U.S. advisers Michael P. Hammer and Mark David Pearlman, as they sat finishing dinner in the restaurant of the San Salvador Sheraton Hotel. As usual following the brutal slayings that are now a daily occurrence there, others have blamed leftist guerrilas.

But regardless of who pulled the trigger, it is clear that the target was Viera and the peaceful road to radical reform he represented.

Viera, a rough-and-tumble man who prided himself on the fact that "I started to work the land when I was 9 years old," was a peasant leader who chose to work within the system, while others long ago turned to revolution as the only hope for change in El Salvador."A leader in the cemetery doesn't do anybody any good," he said in a 1979 conversation.

"Nobody can work here if there is no tranquility, no peace," he said as others called the Salvadoran masses to insurrection. "If there is no work, there is hunger, and hunger is a bad political adviser."

Viera's presence as head of the Salvadoran Agricultural Transformation Institute gave that much-attacked organization -- the focus of U.S. hopes that redistribution of wealth could avert a leftist takeover -- one of its few vestiges of political and popular respectability.

Yet, just before his death, Viera, too, was ready to join the scores of Salvadoran leaders who have given up on peaceful change. In the face of military repression against land reform employes and peasants, as well as government efforts to thwart the reform program by refusing to turn over land titles to new peasant owners and blocking needed loans to peasant cooperatives, friends reported, he had decided to resign.

Viera had been the target of at least five assassination attempts. His enemies included the extreme right, the left and many in the government he worked for.

In many ways, Viera was for years a pivotal figure in the bloody tangle of Salvadoran politics.

Before joining the government last March to direct the agrarian reform, Viera headed the Salvadoran Communal Union, which he said had more than 150,000 members and ran dozens of peasant cooperative farms.

The union was started in 1971 with the help and funding of the American Institute for Free Day Development, an AFL-CIO affilate, and in 1977 it was recognized by the former rightist military government as a legitimate representative of El Salvador's peasants.

Viera claimed to be under no illusions about the repressive character of El Salvador's past and present governments. But, he said in 1979, his way of doing things had gotten results. The peasant cooperatives existed.

"We believe there is a way to exert pressure without violence," he said. "Why do people have to die for change?"

Other peasant groups, such as the Popular Revolutionary Bloc led by doctrinaire leftists and student idealists, "want a popular government, and so do we," he said. "But if we went out in the streets, got involved in politics, [in military] would cut off our heads."

When a group of ostensibly progressive military officers overthrew the rightist government on Oct. 15, 1979, and formed a junta with left-of-center civilians, Viera gave it tacit support. The left charged he had sold out to the right , the rich and the United States.

That government and a later one fell apart amid charges of continuing military repression and human rights abuses.

Seeing its hopes for controlled, peaceful change and the defusing of the appeals of the left dying, the United States and remaining moderates within the government hurriedly pushed through a long-announced plan to expropriate large landholdings and redistribute them to the poor -- the biggest noncommunist land reform in Latin American history.

Viera was tapped to head the program. Hammer was brought in with other U.S. advisers to help him.

For a few months, Hammer said in an interview here three weeks ago, the program went well. But by December, when Hammer said he had come to Washington to warn Ronald Reagan's advisers that Viera was about to quit, it was largely stalled.

"Reagan has to say something," Hammer said then, to disabuse disgruntled former plantation owners and their armed followers, as well as their supporters in the military, of the notion that the conservative new U.S. government would reverse the land reform process.

Violence, he said, came from both the left and the right in El Salvador, but "since June and July, following the Reagan nomination, at least 80 percent of it has come from the right. It won't wait until Jan. 20" for the new administration to begin to formulate policy.

After the most recent government reshuffle, Duarte, the new president, reportedly was under heavy pressure from the increasingly powerful right to get rid of Viera. It apparently was to plead with Viera to fight for his job that Hammer traveled again to El Salvador Saturday.