STOCKHOLM -- During the last years of his life, Sweden's Olof Palme spent much of his time traveling the world in pursuit of two causes -- peace in the Persian Gulf and nuclear disarmament. On the latter issue, he worked closely with his fellow prime minister, India's Rajiv Gandhi.

Today, 18 months after Palme was assassinated on a Stockholm street, Sweden's self-appointed role as an international peacemaker appears to have been seriously compromised.

Palme's legacy has been tarnished by revelations that he used his frequent disarmament meetings with Gandhi to press India to purchase $1.3 billion worth of weapons from Sweden's leading arms producer, the Bofors weapons division of Nobel Industries. Bofors was awarded the contract, to supply a complete field artillery system, in February 1986, shortly before Palme's death.

The reports of Palme's efforts on behalf of Bofors emerged last April, as part of allegations by Swedish state radio that the company had paid at least $16 million in bribes to Indian defense officials. Those charges, currently under investigation in both countries, have caused a major crisis in the Indian government, undermining the domestic position of Palme's friend, Gandhi.

Gandhi has denied that he or anyone in his family has knowledge of bribe-taking. Bofors has "categorically denied" the charge, saying unexplained payments that government auditors found in its books were necessary to pay its agents in India after Gandhi's government insisted that all middlemen be kept out of the deal.

The alleged Indian bribery, however, is but the latest thunderbolt in a growing political storm that has been swirling around Bofors and the Swedish government for two years.

Dubbed the "Swedish Irangate" by the media here, it centers on allegations that Bofors and its explosives division, Nobel Kemi, illegally shipped major quantities of weapons and/or explosives to Iran, Iraq and other Persian Gulf states from 1980 to 1985 -- before, during and after the time that Palme was trying to negotiate peace there.

Bofors has acknowledged some of the sales and denied others. But company executives under suspicion of orchestrating some of the alleged weapons shipments have asserted that they operated with governmental complicity.

That was made difficult to prove last January, when the government official who approved the export licenses in question died, less than a week before he was to be interrogated by prosecutors, in what was officially ruled a suicide.

For conspiracy theorists here and abroad, the death of Carl Algernon indicated either his guilt or the desire of some guilty parties to silence him. A related theory holds that Palme's unsolved murder may have had something to do with the arms sales.

No one has presented any evidence to back up either of these theories, and they are widely discounted by police and by parliamentary, media and other investigators. But they have brought additional attention to the scandal and added to the embarrassment of the Social Democratic Labor government of Prime Minister Ingvar Carlsson, Palme's successor.

The government has denied any knowledge of or complicity in any of the illegal sales and shipments, which allegedly were laundered through neutral third countries. It also has disclaimed any involvement in possible Indian bribes.

According to a recent poll here, however, 53 percent of Swedes believe that the government did have knowledge of the Bofors scandals. The Social Democratic Labor Party has come under fire even from pacifists within its own ranks, who object to all arms exports.

Sweden is not aligned with either of the superpowers. Its policy of what it calls "armed neutrality" and its reluctance to purchase weapons elsewhere have led to an expanded domestic weapons industry that both industry and government agree cannot survive without export orders.

Under Swedish law, however, all overseas weapons sales technically are prohibited. In practice, the government makes exceptions and issues export licenses for countries that it determines are outside "areas of conflict" and observe human rights. Preferred customers are Western European, neutral and nonaligned countries. The entire Middle East has long been considered out of bounds.

Opposition political parties, apparently little concerned that they were in power from 1976 to 1982, part of the period when the alleged sales took place, have capitalized on the scandal. Looking forward to next year's general election, they have charged that the government either must be covering up or should admit incompetence in policing arms sales.

The bewildering series of scandals has spawned an equally confusing array of public and private inquiries, much like the Iran-contra affair in the United States.

A parliamentary committee has held closed hearings.

Three prosecutors are investigating the weapons sales, the explosives shipments and the Indian contract.

Carlsson has started an internal governmental inquiry and named a special independent committee, akin to the Tower commission, to look into government involvement in the Indian deal.

The department charged with investigating competition questions is looking into whether, as alleged by Swedish customs, the sale of explosives to Iran and other countries was orchestrated by what amounted to a cartel of Western European producers through fixed prices, shared contracts and laundered illegal shipments.

An official in the Trade Ministry, which has responsibility for approving weapons export licenses, was asked if the need to investigate and respond to the scandals had distracted his department from its normal duties.

"There are no normal duties here anymore," he said. "Just this."A Visit to the Police

The Bofors affair first leaped into public consciousness in May 1984, when Lars Angstrom, the head of the Swedish Peace and Arbitration Society, the world's oldest peace group, made a surprise visit to Stockholm's police headquarters, a Swedish television crew in tow.

Angstrom and researcher Henrik Westander presented the police with the results of several years of investigation, most of it from public sources. They said their information proved that in 1980, Bofors had sold its RBS70 surface-to-air missile to Bahrain and Dubai in the Persian Gulf. Both were on the sales-prohibited list, and the government had turned down a 1978 Bofors request to license the sale of the same items -- a total of 304 missiles, worth a reported $10 million -- to the same two countries.

According to Westander, the missiles had been laundered through a licensed, interim sale to Singapore, whose weapons imports from Sweden had suddenly increased a hundredfold in 1979, to about $27 million. Despite the small size of its armed forces, Singapore had become the largest single importer of Swedish armament, a position it has maintained throughout the 1980s.

The police listened politely, but it was not until the society came up with a stack of secret Bofors documents, supplied by a disaffected company engineer on the RBS70 project, that they began to take the charges seriously. In May 1985, government prosecutors announced that they had begun a full investigation of the charges.

In December 1986, the society alleged that RBS70s had been found in Iran. Their evidence included references in well-known publications, including American newspapers, and what the organization said was the independent testimony of four separate sources. No company documents were produced to back up this charge. Upheaval at Bofors

About the time that the peace society was presenting its first charges against Bofors, the company was in the midst of an upheaval. In the early 1980s, financier Erik Penser had taken over the weapons producer and its sister company in explosives, Nobel Kemi. One of Sweden's oldest companies, Bofors had been bought in the 1880s by Alfred Nobel, the inventor of dynamite and patron of the peace prize.

The Swedish Peace and Arbitration Society was itself a winner of the prize in 1908.

In late 1984, Penser merged Bofors-Nobel Kemi with another acquisition, creating Nobel Industries, 25 percent of whose revenues came from defense production. In January 1985, he appointed Swedish businessman Anders Carlsberg as chairman.

By early 1986, Carlsberg was sufficiently concerned about the prosecutor's inquiries, and the reliability of his inherited staff, that he hired an outside auditor to review all recent sales and deliveries made by Bofors and Nobel Kemi, and to trace all RBS70 missiles produced for export since 1977.

Carlsberg had an additional worry. A separate inquiry into Bofors-Nobel Kemi deals was being conducted by Swedish customs police, begun when customs officers received an odd message from their counterparts in West Germany in October 1984.

According to Hans Johnson, chief of the customs criminal investigation division, "it was a simple request. They had observed two railroad wagons, loaded with explosives, coming from Sweden and transiting West Germany for Austria. But when the wagons got to the West German town of Passau, on the Austrian border, they stayed for a couple of days and then were redirected to Hamburg. From there, they were put on a ship to Syria."

Johnson paid a surprise visit to Bofors, where he "took some papers and noted some very peculiar things. There was a permit to export to Austria, for example, but it called for the explosive to be mixed with 25 percent water, something that's only required for a long sea shipment."

Johnson called the local prosecutor and got approval for search warrants. During 1985, customs officials made at least two dozen raids on Bofors, eventually accumulating a roomful of documents.

"There were shipments to Iran, Egypt, Syria, Burma, Iraq -- you wouldn't get a permit to export to any of these countries," customs investigator Tor-Bjorn Sebell said. But in each of these cases, he said, the contract for illegal delivery was covered by a separate order to ship the explosives to a third country, usually in Western Europe.

The 7,000-page report that customs turned over to the prosecutor last spring documented 10 "representative" cases of alleged explosives smuggling between 1980-85, involving illicit shipments valued at $12 million, and attempts to smuggle an additional $12 million worth that were thwarted by customs. Most of the cases list Iran as the final buyer.

In an interview, Johnson and Sebell detailed one of the cases. According to their allegations, it began in early 1984, when Tehran ordered 4,700 tons of gunpowder from Swedish trader Karl-Erik Schmitz. Schmitz's company, Scandinavian Commodities, in the southern port city of Malmo, is depicted as playing a leading role in a number of the alleged deals.

Schmitz first went to South Africa, where he issued contracts for 3,000 tons of the Iranian order. Next, in the company of Martin Ardbo, then marketing director of Bofors, Schmitz went to Yugoslavia's state trading organization, FDSP, to order an additional 1,300 tons.

In the same meeting, customs alleges, the Yugoslav agency ordered the same 1,300 tons, worth approximately $14 million, from Bofors. Bofors subsequently received a Swedish government license to export the gunpowder to Yugoslavia.

Bofors was unable to fill the large order itself, and subcontracted 950 tons to Muiden Chemie of the Netherlands, which in turn subcontracted part of its order to a Canadian company.

Bofors ordered an additional 50 tons from Kenira, in Finland; 55 tons from Raufoss, in Norway, and 100 tons from Nobel Explosives Ltd. (unrelated to the Swedish company), in Scotland. The assembled order was then loaded on a West German ship bound for the Yugoslavian port of Bar.

In Yugoslavia, Bofors officially turned the shipment over to FDSP, which immediately sold it to Schmitz, who then shipped it to Bandar Abbas, in Iran.

Payment from Tehran to Bofors allegedly traveled by an equally circuitous route. Deposited in Iran's Bank Melli, in London, it was transferred to two separate accounts, in London and Luxembourg banks, belonging to Scandinavian Commodities, which then transferred it to Yugoslavia. The Yugoslavs paid Bofors, which distributed payment to its subcontracted suppliers.

According to the customs investigators, this type of transaction has taken place again and again throughout the Iran-Iraq war, arranged by what amounts to an informal explosives cartel that is now being investigated in several European countries.

Last May, indictments for violating weapons export restrictions in the explosives smuggling case were issued against two Bofors officials, former Nobel Kemi marketing director Mats Lundberg and Goron Karlsson, and against Schmitz, of Scandinavian Commodities.

The officials have denied the charges and said they have no knowledge of any reexport of explosives that might have taken place from countries to which they made legal sales. A trial is expected before the end of the year. Question of Official Okay

In early January, according to numerous accounts here, Ardbo, newly named as Bofors president, told Nobel Industries Chairman Carlsberg that illegal weapons shipments via Singapore had taken place. But, Ardbo said, Bofors had acted with the knowledge of successive chiefs of the government weapons inspection service.

The question of government approval was crucial, since its existence would mean that Ardbo could not be prosecuted.

Carlsberg left his meeting with Ardbo and went to see Algernon, the chief weapons inspector. That same afternoon, minutes after his meeting with Carlsberg ended, Algernon went to a Stockholm subway station and died under the wheels of a train.

Several self-described witnesses said he had been pushed, while others said they had seen him fall accidentally. In its ruling that Algernon committed suicide, an official investigation gave no evidence to support its conclusion, and did not speculate as to motive.

On March 30, Carlsberg held a press conference to release the results of his independent audit. He said that missiles had been sold illegally to Bahrain and Dubai in 1980. Other illegal transactions, he said, included the sale of naval cannons to Thailand, and ammunition and explosives to Oman and East Germany. Carlsberg said he had found no evidence of missile shipments to Iran.

The company declared that Ardbo and a previous Bofors president, Claus-Ulrick Winberg -- both of whom had lost their jobs -- were "morally guilty" of smuggling.

Both Ardbo and Winberg have maintained that the government knew all about the false licenses and allegedly illegal shipments. Quoted in Britain's Business magazine last June, Ardbo noted that Bofors had invested a "great amount of money" in producing the RBS70 for Swedish use. "We had received a promise," he said, "that it would be considered a defensive weapon and be allowed to be exported around the world."

The prosecutor's probe of the missile sales is not expected to be completed until next year. Results of the government's internal investigation are due "pretty soon," said Carl-Johan Aberg, undersecretary of state in the foreign trade department.

"Even though it's not yet gone through the court process," Aberg said, "I think it's appropriate to say we have found large deviations when it comes to missile sales to Singapore. We have joined forces with Singapore authorities in investigating." A leading Singapore executive has been arrested there.

Aberg acknowledged that in hindsight, it was fair to say that the government had been less vigilant than it should have in the issuance of weapons export licenses, and in not looking into the massive increase in sales to Singapore.

On the question of Iran, Aberg said that "every month, there are rumors and accusations about sales of Swedish missiles. We do not give permits for any ordnance equipment to Iran. I'm always saying, 'Give us the evidence.' But up to now, no one has."

As for the assorted Bofors scandals in general, Aberg said, "It is out of the question that this could have happened with the approval of the Swedish government."