The military governments of Guatemala and Honduras have rushed troops and tactical air support to their borders with El Salvador in response to a broad leftist guerrilla offensive there, according to diplomatic sources.

In Nicaragua, meanwhile, a virtual mutiny broke out today at the Salvadoran Embassy when the ambassador and his staff walked out "in disgust" to join the opposition in their country.

At the nearby U.S. Embassy in Managua, a group of almost 40 Americans peacefully demonstrated against resumption of military aid to El Salvador. The group, including many from the Catholic Church, had talked of occupying the embassy, but Ambassador Lawrence A. Pezzullo, reached by phone, said they presented a protest note and declared they had "accomplished their purpose, were pleased with the results and were not coming back tomorrow."

Guatemalan and Honduran troop movements reportedly began early this week following recent high-level military consultations among the three military-ruled Central American neighbors.

The Salvadoran opposition has charged the troops are poised to cross into El Salvador to fight on the side of the U.S.-backed junta. But Guatemala and Honduras have said their intention is to seal their borders against infiltrating guerrillas and not to participate in the Salvadoran civil war.

Adding to the increasing regionalization of the Salvadoran conflict, Guatemala's four leftist guerrilla organizations have stepped up antigovernment actions this week.

In a joint communique, the four Guatemalan groups said they were fighting "in solidarity with the Salvadoran offensive." But it was reliably reported that the Guatemalan guerrillas are acting to distract and pin down Guatemala's armed forces at home to prevent them from assisting Salvadoran troops.

At El Salvador's embassy in Managua, the ambassador, Roberto Castellanas, said in a communique announding his change of allegiance that at first he had believed in his government's reform programs but found that its leaders were "persecuting the Catholic Church," and were "cowardly, arrogant and bloodthristy."

Nicaraguan officials reached by telephone said, in reference to U.S. charges that guerrilla forces and arms were entering El Salvador from Nicaraga, that there was "deep concern" in the government about the apparent U.S. attempt to involve them in the Salvadoran conflict. They repeated their emphatic denials that Nicaragua was providing logistic support for the Salvadoran guerrillas.

Of the neighboring countries, the Salvadoran civil war appears to be affecting Guatemala most deeply. "The place has been in turmoil all week," said a U.S. source reached by telephone there, "ever since the weekend offensive in El Salvador."

Guatemala's guerrilla forces, which have been gaining in size and popular support, claimed responsiblity for the killing this week of two prominent members of the far-right National Liberation Movement. The slain men were a prominent congressman and the mayor of a provincial town.

This has prompted the leader of the movement, former vice president Mario Sandoval, to cancel a trip to Washington where he was invited to attend inauguration ceremonies.

Twice this week the guerrillas also claimed to have ambushed Army convoys, wounding and killing an unspecified number of soliders.

A U.S. source in Guatemala said that the nation's armed forces had sent several thousand men, including planes and helicopters, to their side of the border with El Salvador.

The Guatemalan guerrillas in turn claimed to have strategic posts to watch Guatemala's military movements near the border. On Wednesday, according to a police spokesman, presumed guerrillas intercepted a car close to the border in which a Guatemalan Army captain and two other men were returning from El Salvador. The three men were killed.

A spokesman for Guatemala's guerrillas earlier this week charged that close to 500 Nicaraguan ex-guardsmen, exiled in Guatemala, had crossed into El Salvador to fight as mercenaries on the government's side.

There have been repeated but unconfirmed reports that Guatemala's traditional rightist paramilitary groups had been recruiting heavily among the Nicaraguan exile community said to include 10,000 former supporters of overthrown dictator Anastasio Somoza.

The U.S. source in Guatemala said that while there was no proof of such mercenary crossings, "we can assume that there is as much solidarity among the armed rightists of Guatemala and El Salvador as there is among the guerrillas."

The role of the Honduran armed forces vis-a-vis El Salvador has led to serious disputes among the Army high command, according to U.S. and Honduran sources there. El Salvador's current vice minister of defense, Col. Jose Castillo, reportedly visited Honduras in late December to ask its chiefs of staff for military support.

The Honduran president, Gen. Policarpo Paz Garcia, reportedly opposed any involvement but was overruled by an Army high command decision to send close to 2,400 troops to patrol the border area, which has long been a hideout for Salvadoran leftist guerrillas. Honduran Defense Minister Col. Mario Flores has stated that his country's troops "will not intervene in El Salvador in favor of either side." His country's troops, he said, would "protect our territorial integrity and they are involved and ready for this task."