A judicial investigation into the activities of two former Libyan diplomats here has uncovered a web of mysterious bank accounts around Europe totaling millions of dollars that preliminary evidence indicates was used to fund Libyan terrorism.

Italian judicial sources close to the continuing investigation said their success in recent months in tracing more than a half dozen bank accounts in the name of the two Libyan former diplomats has strengthened their conviction that the Libyan People's Bureau, or embassy, in Rome has played a decisive role in supporting Libyan terrorism in Europe.

The two Libyans under investigation, Arebi Mohammed Fituri and Mussbah Mahmud Werfalli, held important positions in the People's Bureau in Rome until last year.

Both men were named by a Libyan picked up carrying a pistol and a check for $25,000 from one of them. He told investigators he had been hired to assassinate U.S. Ambassador Maxwell Rabb. This arrest spurred an extensive investigation, including the tracing of large bank accounts held by Fituri and Werfalli.

In this case and in at least two others, checks signed by either Fituri or Werfalli have been traced to apparent terrorist operations, the sources said. The investigation has unearthed evidence that the two diplomats also maintained accounts in Malta, Switzerland, England, West Germany and Morocco, strengthening the suspicion that they were the main overseas bankers for Libyan terrorist operations.

"There is clear evidence that money from Fituri's and Werfalli's accounts was used to support what we could term terrorist operations," said one of the judicial officials close to the investigation, who refused to be named. "That these accounts run by these diplomats were everywhere, and contained millions of dollars, leads us to believe they were key to a much larger Libyan network than we have yet been able to sketch."

Fituri, who left the Rome People's Bureau at the end of 1985 after a three-year tour as an administrative counselor, was arrested last April after he returned to Italy as an official of Libyan Arab Foreign Investments Company, a Libyan holding company that owns a 15 percent share of Fiat, the Italian automotive and industrial firm. He remains in Italian custody.

Werfalli, who served in the Rome embassy for three years, one year as charge d'affaires, was expelled from Italy in April 1985 before Italian judicial authorities began to investigate him and was last traced to the Libyan People's Bureau in Valletta, Malta. No reason was given for his expulsion at the time.

The two Libyan diplomats first came to the attention of Italian authorities in 1985 when they detained a Libyan who said he had been hired to assassinate in connection with a still unclear Libyan "plot" U.S. Ambassador Rabb or, if that failed, the ambassadors of Egypt and Saudi Arabia.

The man who told the authorities of the alleged plot was Rageb Hammouda Daghdugh, who has portrayed himself as a hired gun for the Libyans and a CIA double agent and agent provocateur. Daghdugh was arrested in Rome Feb. 5, 1985 carrying a Walther P38 pistol and a check for $25,000 signed by Fituri, which he later told Italian judicial officials were to be used for the assassination of Rabb. Daghdugh has told interrogators that Fituri and Werfalli recruited him for the ambassadorial assassination, giving him the gun and the check.

Officials at first were skeptical about Daghdugh's charges because of his seeming double role. However, the gun and the check were evidence that made judicial officials here begin a probe that has now lasted for more than a year and a half and has gained seriousness as further evidence is uncovered linking the two diplomats, and, by implication, their Rome embassy to terrorism.

First, it was discovered that the P38 in Daghdugh's possession at the time of his arrest was traceable to a lot of Walther pistols sold by the West German gun maker to Libya earlier this decade. Daghdugh told investigators he had been given the gun by Fituri after the two former diplomats had accosted him on a Rome street and ordered him to assassinate the ambassadors.

Then it was discovered that Werfalli had been named by four Libyans captured in Egypt as an organizer of a plot to assassinate former Libyan prime minister Abdel Hamid Bakoush at his exile home in Alexandria, Egypt, a year ago, the sources said.

The most recent and intriguing evidence against the two Libyan diplomats, however, has emerged from a major tracing of their bank accounts, according to investigators.

The probe conducted by investigating magistrate Rosario Priore and prosecutor Domenico Sica, two of Italy's leading antiterrorist experts, first unearthed the fact that Fituri maintained accounts totaling more than several million dollars in three Rome banks: the Banco di Roma, the Libyan-run Union of Arab Banks in Italy and the American Express' American Service Bank. It was discovered later that he maintained another account, with half a million dollars, in a bank in Geneva.

In interrogations, sources here said, Fituri said these accounts were maintained to pay scholarship fees to the thousands of Libyan students in Europe, even though at least $25,000 had been paid to Daghdugh.

More intriguing to investigators are the accounts in Werfalli's name. Apparently, until he was named persona non grata by the Italian Foreign Ministry in April 1985, he maintained a bank account in his own name at the Banca Nazionale del Lavoro in Rome that contained $2 million and 3 billion lire, worth about $2 million at current exchange rates.

Before leaving Rome, according to the judicial sources, he apparently closed that account and opened a series of others, one in Bank of Valletta in Malta, another in the Lloyds Bank of Geneva, another in the Banque Commerciale du Maroc in the Moroccan capital of Rabat and a fourth in the Dresdner Bank in Hamburg, West Germany.

What interests Italian investigators in Werfalli's bank accounts is the fact that almost every check he cashed in his account in the Banca Nazionale del Lavoro was made out to him so its origins could not be traced.

The exceptions are the check made out to Daghdugh and two checks totaling $240,000 that were made out to a man named Clifford Chadwich Shepherd, who, according to investigators, is a British arms dealer who was caught in England last year seeking to ship 50 pistols with silencers to Libya.

While the investigation by Priore and Sica is continuing, judicial sources said they believed that Fituri's and Werfalli's bank accounts were intended primarily, if not exclusively, to finance the procurement of terrorist weapons and materials, the payments of agents and the funding of terrorist operations.