A ship idled mysteriously off the coast of Peru two months ago, then steamed for Panama, where officials, acting on a tip, boarded the vessel and discovered crates of East German-made automatic rifles and antitank grenade launchers that were not listed on the ship's manifest.

The freighter carried enough hidden weapons to equip 1,500 men. Where were the arms going?

That question has puzzled Peruvian investigators, creating a minor scandal here that has pointed to Peruvian Navy personnel and raising suspicions that U.S. officials may also have been involved in a possible clandestine effort to smuggle Soviet Bloc weapons to the anticommunist guerrillas battling the Sandinistas in Nicaragua.

The incident has soured relations between this Andean nation and the East German government, which has been slow and cursory in answering Peruvian requests for documents. Peru recalled its envoy from East Berlin earlier this month.

One of the few things senior government officials seem sure about is that the communist-made weapons were not destined for members of the Maoist Shining Path guerrilla movement in Peru. Unnamed U.S. officials in Washington had promoted this theory with reporters in June when news of the ship's mysterious cargo surfaced.

At the time, Peruvian security forces were brutally suppressing simultaneous uprisings by captive rebels in three prisons. The Washington sources suggested then that the arms shipment had been meant to aid the jail mutinies.

But Peruvian officials say they have found no evidence linking the illegal arms to Shining Path, a fanatic group that has shunned foreign assistance as well as alliances with other leftist parties. The rebels generally fight with guns and explosives stolen from Peru's armed forces and police.

At least two Cabinet-level officials informed about the government's investigation suspect some members of the Peruvian Navy of involvement, although the officials say the Navy as an institution was not responsible. Gen. Jorge Flores Torres, the minister of war, denied that the weapons were intended for the armed forces, which have suffered recent budget cuts.

In the past, both the Army and Air Force have purchased arms from the Soviet Bloc, but the Navy has not.

Among the many open questions are these: If some naval officers were trafficking, did they intend to use the East German arms in Peru? Or were they acting as decoys to fool the East Germans about the real destination of the arms somewhere in Central America? Or were they just trying to turn a quick profit by planning to resell the weapons?

The ship, named the Pia Vesta, left the East German port of Rostock in early May flying a Danish flag and destined for the Peruvian port of Callao. On board were 32 trucks and 99 crates containing 1,500 Kalashnikov rifles and 1,440 rocket-propelled grenade launchers.

Labels on the crates were addressed to the "Nawy sic of Peru, Callao, Peru." The bill of lading showed the cargo had been ordered by a firm named Marnix S.A. of Montevideo, Uruguay, and consigned to a Swiss-based company called Sinato International Inc. Neither firm can be found to exist except on paper and both appear to have been the creation of a Miami resident named David Duncan.

Before the freighter reached Peruvian waters in early June, the CIA alerted the Peruvians to the shipment, according to an informed foreign source. The same source, as well as several top Peruvian officials, said the Navy was slow to initiate an offshore search.

The ship never docked in Peru. Instead, it received new orders from Copenhagen on June 9 to leave Peruvian waters and proceed to Balboa, Panama.

Peruvian President Alan Garcia, frustrated by the Navy's failure to intercept the freighter, phoned Panamanian military leader Gen. Manuel Antonio Noriega, who seized the cargo, according to a source close to Garcia.

Duncan, who describes himself as an arms dealer and answers a Miami phone number, said the shipment belonged to him. In a phone interview, he said the arms had been bought by Peruvian Navy officers -- he would not give names -- who backed out of the deal when the Pia Vesta was en route.

"The Navy of Peru won't admit they were into a negotiation," Duncan said. "They didn't have the guts to go tell their president" about the deal.

Scrambling to find another buyer, Duncan said, he had arranged with Gen. Adolfo Blandon, head of the joint chiefs of staff in El Salvador, to sell the weapons to El Salvador. Blandon has denied involvement.

Duncan said the plan was to reroute the cargo from Peru to Panama, where it would be transferred from crates to containers, then flown from Howard Air Base in U.S. military aircraft to Acajutla in El Salvador. Duncan said he had cleared the transfer operation through Emilio Ortiz de Zevallos, a Panamanian port official.

Peruvian officials have a transcript of a three-way phone conversation June 18 among Duncan, Ortiz de Zevallos and Alberto Coppo Gayoso, a retired Peruvian Army major who Duncan says works for him. In June Coppo traveled from Miami, where he now lives, to Peru, apparently to handle the expected arrival of the Pia Vesta.

Ortiz de Zevallos asked Coppo on the phone to name the Peruvian naval contacts involved. Coppo said he could not do that on an open line. But he added, speaking from Lima: "Here they knew at a very high level of the internal decision."

Asked if he is referring to "Nico" (possibly the Navy commander, Vice Adm. Victor Nicolini), Coppo replied: "Could be."

The weapons are still being held by Panama. Duncan says the Honduran armed forces have agreed to buy them.

With so many questions unanswered, the affair has become a foil for all kinds of political charges and countercharges in Peru. Some opposition politicians have suggested that the arms were being imported by aides to Garcia to fortify forces of the president's party, the American Popular Revolutionary Alliance.

A Peruvian magazine owner, Enrique Zileri, said he suspects the United States of masterminding the shipment to supply the contras, using El Salvador as a conduit. American officials deny it. The CIA tip to the Peruvians is offered as proof by some informed sources here that the United States was not behind the operation. The CIA is said to have assumed initially that the arms were destined for Managua.

But Zileri's magazine, Caretas, which has pursued the curious episode, surmised that the operation may have been run by another U.S. government agency that did not advise the CIA or that drew CIA opposition.

In any case, Peruvian officials say there was a second bill of lading from the firm Chartering APS, dated April 29, consigning the shipment to the armed forces of El Salvador. This would suggest that some kind of triangulation plan had already been arranged even before the freighter left Rostock.

Meanwhile, East German authorities also appear to have an internal scandal to sort out. The East German government stated in a note delivered Aug. 14 to Peruvian Foreign Minister Allan Wagner that one of its state firms had falsified the Pia Vesta's manifest.

The manifest, prepared by VEB Schiffsmaklsei Rostock, had omitted mention of the weapons on board. The diplomatic note said the firm had acted improperly.