Gen. Walter Lopez resigned yesterday as commander in chief of the Honduran armed forces in a major shake-up that diplomats and Honduran political sources described as the result of an internal power struggle within the nation's influential military.

Lopez's resignation, which came just five days after the inauguration of civilian President Jose Azcona, raised questions about whether the armed forces intended to change its policy regarding the presence in Honduras of Nicaraguan counterrevolutionaries called contras.

Reuter quoted senior military sources as saying that Lopez's decision to quit was precipitated by angry complaints from other officers that he had promised to allow resumption of U.S. nonlethal aid shipments to the contras without consulting the rest of the armed forces' leadership.

But diplomats and Honduran political sources, contacted by telephone in the capital of Tegucigalpa, said they believed interservice rivalries and the professional ambitions of individual officers were the main reasons for the change.

"The people who were involved in the ouster were not people who are known for being rigid opponents of the contra program," a well-placed source in Tegucigalpa said.

Lopez's resignation was viewed by some political observers as a setback for U.S. policy in Honduras because it reflected instability in the armed forces and because Lopez had been a strong defender of civilian, democratic rule.

But a U.S. Embassy spokesman issued a statement saying: "It appears that this is a purely internal armed forces matter . . . . We do not expect that these events will have any effect on the excellent relations that the United States enjoys with Honduras. We don't believe that this represents a threat either to the Azcona government or to Honduran democracy."

It was unclear whether Lopez wanted to step down when he did. He had made a surprise announcement on Thursday that he intended to resign soon for personal reasons, but he retracted that statement on Friday and said he planned to stay on.

Yesterday the armed forces ended the confusion when its public relations office issued a statement saying that Lopez had resigned "in irrevocable form." It said Col. Efrain Gonzalez would serve as commander in chief until senior officers selected a new leader.