Frank Terpil of McLean is an international arms dealer plagued with what his friends and law enforcement authorities say is a hazardous habit. He likes to boast.

Before he was arrested two weeks ago for trying to sell 10,000 machine guns to undercover detectives in New York City, Terpil allegedly told one of them he had personally observed and participated in torture and murder in Idi Amin's bloody Uganda.

The statesments Terpil allegedly made "may appear so fantastic as to be unbelievable," says Matthew Crosson, an assistant Manhattan district attorney in charge of the Terpil case there. "But, on the other hand, Terpil did a lot of unbelievable things that were real."

Known to his McLean neighbors as a friendly but quiet importer-exporter who was frequently away from home, Terpil's business activities gave him a vastly different reputation among authorities.

According to New York prosecutors and sources close to a two-year federal grand jury investigation of Terpil in Washington, Terpil has been one of the world's major merchants of lethal weapons, torture devices and explosives to repressive gorvernments since at least 1975.

Sources say Terpil, 40, provided the handgun in a failed plot by Libyan leader Col. Muammar Qaddafi to assassinate one of his political enemies in 1976. Terpil, according to sources familiar with the federal investigation, also maintained an office in the Libyan Embassy in London where he entertained Qaddafi.

Prosecutor Crosson in New York said Terpil contracted in 1976 with Qaddafi to provide bomds in the form of ashtrays, lamps and exploding desks, along with timing devices and former American special froces personnel to help train Libyan terrorists. a

Documents show that in 1977 in Uganda, Terpil, working through a Paris-based company, sold $3.2 million worth of weapons, surveillance equipment and explosives to the government of Idi Amin. Documents also show he helped trian Amin's dreaded State Research Bureau murder squads in the "art of intelligence sabotage." Sources say that at other times Terpil sold Amin torture equipment, including "electrical collars."

At a hearing on Friday in New York State Supreme Court, Crosson said that Terpil bragged to undercover detectives that in Uganda he put a liquid explosive in the car of an unidentified foreign diplomat, then blew the car to pieces with a radio-controlled detonator.

Until Amin was chased from Uganda last spring, Terpil flew to Kampala as often as twice a month where he stayed as a personal guest of his "very good friend Amin," according to Eldad Wapenyi, the current Ugandan ambassador to the United Nations. Terpil sold nearly $800,000 in military supplies to Amin last year. Wapenyi says. He adds that the present Ugandan government is still trying to figure out if Terpil has been paid for the equipment.

Terpil, who sources say made up to 1,500 percent profits on his arms and equipment sales, also bought personal items for Amin, including picking up a Maseratti sports car engine in Italy and delivering it to Kampala, sources say.

In New York, where Terpil and another arms dealer, George Gregary Korkala, were arrested on Dec. 22 on weapons charges, Terpil's lawyer, James LaRossa, acknowledges that his client deals in international arms, but claims all the dealings are legal.

Korkala's lawyer, Gustave Newman, concedes that his client tried to sell 10,000 machine guns to undercover detectives posing as South American revolutionaries, but also claims no crime was committed.

"It may be unfortunate, it may be immoral, but it is perfectly legal," Newman said in a recent New York court hearing. On Friday, lawyers for both Terpil and Korkala argued that their clients had done extensive legitimate work for federal agencies such as the FBI, the Secret Service and the Federal Aviation Administration. Sources in Washington say Terpil has done no work for federal agencies in the last five years.

A New York Supreme Court justice on Friday set bond for Terpil and Korkala at $100,000 each, despite prosecution arguments that they may flee the country. The two, who pleaded innocent to nine counts of conspiracy and other weapons violations, had not made bond by yesterday afternoon.

In New York, Terpil and Korkala face maximum possible prison sentences of 25 years if convicted. State Department officials say any unlicensed shipment of arms out of the United States is a violation of federal law.

Sources close to the grand jury investigation of Terpil in Washington say the panel is looking into possible violations of the Foreign Agent Registration Act (10 years maximum prison term) and the Munitions Control Act (eight years maximum prison term.)

Before his arrest, authorities say Terpil lived a good part of his life aboard airplanes, shuttling to his "safe" house in Crewe, England (where his confederates in the arms trade allegedly stayed), to Paris, to Geneva (where he allegedly keeps large amount of money in Swiss banks) and to the palaces of arms customers in Africa and the Middle East, including Syria and Lebanon.

Sources say Terpil is a "super salesman" with a knack for charming influential people and maintaining close contacts with sources of business associates. His weaknesses, sources say, are that he kept shoddy business records and had a tendency to brag about business successes to other arms dealers.

Terpil, 40, a stocky, brown-haired man with a thick mustache, lived until his arrest with his wife and two teen-age sons in a $260,000 Japanese contemporary home on Chain Bridge Road in McLean. Since his arrest; the house, which he purchased in 1978, has been put up for sale.

Frank Edward Terpil was born in Brooklyn and enlisted in the Army when he was 18. He spent an uneventful six years in the military, serving his second tour of duty in Arlington with the Army's security branch. His job was to repair cryptographic (code-breaking) equipment and his electronics training was extensive, according to Army records.

When he left the Army in 1965, Terpil joined the CIA as acommunications specialist. Although the CIA has refused to comment, sources close to the grand jury investigation in Washington say Terpil was fired from the agency in 1971 because his boastful and unpolished manner did not fit his superiors' expectations.

While in the CIA, Terpil spent time in the Middle East and East Pakistan, sources close to the investigation say.

Terpil next came to the attention of federal authorities in 1975 when he began selling the silenced Mac-10 and Mac-11 Ingram machine guns manufactured by Mitchell WerBell III of Powder Springs, Ga., sources say. The Mac-11 machine gun weighs less than four pounds, fires 850 rounds a minute and makes a soft phyyt sound when fired. It has been featured in such movies as "Three Days of the Condor" and "Killer Force."

WerBell, an internationally known arms dealer, said yesterday "that from time to time Frank has worked for us" selling the machine guns. But WerBell said that any dealings he had with Terpil were approved by the State Department office of munitions control.

According to federal sources, the machine guns were sold to a number of Third World countries.

In 1976, Terpil began supplying arms and other military equipment to Libya's Qaddafi. Sources say Terpil became a working partner with former CIA operative Edwin P. Wilson, who owns a large firm in Loudoun County and was also linked to the aborted assassination attempt of one of Quaddafi's political opponents in 1976.

Terpil and Wilson, working through relatives of Quaddafi, became friends with the Libyan leader and began supplying him with a total of $2.5 million worth of military supplies. The hardware ranged from small arms to at least one American-made ground-to-air Red Eye missile, according to sources close to the grand jury investigation.

Sources say that Terpil and Wilson manufactured timing devices for explosives at a production cost of $4 to $6 each and sold them to Libya for about $650 each during 1976 and 1977.

The Central Intelligence Agency, angered and embarrassed by Terpil's dealings with regimes that the agency was trying to monitor, assisted the Justice Department and Treasury officials in gathering information on Terpil, according to sources close to the grand jury investigation.

Terpil and Wilson, sources say, recruited teams of American-trained guerrilla fighters and electronics experts to teach Qaddafi's troops how to fight and make bombs. Later, Terpil and Wilson apparently had a disagreement and stopped working together.

Terpil -- using connections he had made in Libya -- began selling arms to Amin in Uganda, sources say.

According to a contract stamped "secret" found in the State Research Bureau files in Uganda after Amin's fall, Terpil's company sold $3.2 million worth of equipment in August 1977. This included disguised antennas, attache cases fitted with tape recorders, explosives, remote radio detonators, a 56-track telephone monitoring system and all kinds of interrogation devices.

In 1978 and early '79, Ambassador Wapenyi said, Terpil had an office in the Uganda Mission on 45th Street in New York. Terpil helped with the installation of an elaborate surveillance system that placed listening devices in various rooms in the mission, enabling the monitoring of Amin's diplomates, Wapenyi said. The ambassador said that Terpil had the equipment, valued at $1 million, removed when Amin's government was overthrown.

During the years when Terpil was selling arms to Libya and Uganda, he frequently stayed in Geneva, where sources say he keeps an undisclosed amount of money. Sources believe that Terpil often returned to the Washington area with large amounts of money, which he used to pay his mortgage and other bills.

Terpil's family refused to comment on the arms dealer's activities.

New York police said they became aware of Terpil while investigating an unrelated case. Undercover detectives were sent to meet Terpil in England where they were shown a large quantity of machine guns, prosecutor Crosson said.

Terpil and Korkala were arrested at the New York Hilton hotel after undercover agents alledgely paid them a $56,000 deposit on 10,000 machine guns, worth $2 million, Crosson said. CAPTION: Picture, Frank Terpil in Libya, at a celebration of the Libyan Revolution in 1979. By Michael and Aubine Kirtley, Life; Copyright (c) 1979, Time, Inc.