In early 1982, CIA Director William J. Casey received a visit from Israel's defense minister, Ariel Sharon, a burly, truculent former general with extreme, hawkish ideas. Lebanon, and the Palestine Liberation Organization strongholds in that country, were on Sharon's mind. Israel was determined to drive the PLO terrorists out of southern Lebanon. It was also trying to extend its influence over that country, torn by fighting between Christian and Moslem groups, by giving covert paramilitary support to the main Christian militia -- the rightist Phalangist Party, headed by Bashir Gemayel, a baby-faced ruthless warlord.

At 34, Gemayel had developed into one of Lebanon's most powerful and charismatic leaders, forging a unique and important future role for himself. Israel's game plan seemed to be working, and to ensure its success, Sharon had a request of Casey: Could he provide $10 million in secret CIA paramilitary support to Gemayel?

The request met with stiff opposition from Casey's deputy, Adm. Bobby R. Inman. After a year of working with Casey, Inman was growing increasingly troubled, particularly with the expansion of covert actions. Casey was aligning the Central Intelligence Agency with some of the major unsavory characters in the world. Bashir Gemayel was one of them.

Gemayel was a savage murderer. In 1978, Gemayel's forces had made a lightning attack on the summer resort home of Tony Franjieh, the political heir to the rival Christian faction, slaughtering him, his wife, their 2-year-old daughter, the bodyguards and even the domestic staff. In 1980, Gemayel's militia had come close to wiping out the Christian militia of Lebanon's ex-president Camille Chamoun.

But there was more -- something hidden in the intelligence files at CIA headquarters in Langley.

In the 1970s, after studying political science and law in Lebanon, Bashir Gemayel had come to the United States to work for a Washington law firm and had been recruited by the CIA. He was not an agent who was controlled, though he was paid CIA money regularly and was given a crypt -- a special coded designator -- so that his reports could circulate widely with few people knowing the source's identity. Initially, the payments were token amounts of several thousand dollars -- a straight exchange of cash for information.

As the youngest of the six children of Pierre Gemayel, then the Phalangist leader, Bashir seemed destined for relative obscurity in the powerful family. By Lebanese custom, his oldest brother was first in line to inherit leadership in the party, founded in 1936 as a sports and military youth movement. But in 1976, Bashir took charge of the militia in place of his brother, and both the payments and his importance to the CIA grew.

The CIA maintained a large presence in Beirut, the crossroads of the Middle East, the most westernized of the Arab capitals, teeming with intrigue, as powerful and wealthy Lebanese traveled the region, providing good intelligence about less accessible Arab countries. The CIA soon considered Bashir Gemayel a "regional influential," a major asset. At the same time, within Lebanon, he was evolving into a leader with wide appeal, a patriotic visionary who spoke of a "new Lebanon."

There was an inclination in the CIA to side with the Christians over the Moslems in Lebanon. But old CIA hands who had served in Lebanon knew that the Christians, particularly Gemayel and his Phalangists, were as brutal as anyone and would never win the allegiance of the country's large Moslem population. The relationship was hazardous. "What worthwhile relationship isn't?" Casey asked, trying to calm the agency's hand-wringers.

Nonetheless, Inman still considered Gemayel a murderer and felt strongly that the CIA should not dance with this devil anymore. He recommended against providing the $10 million in covert aid that Sharon had requested. The Israelis and Sharon were cooking up something; they had too much influence in Lebanon, and were seeking more.

Sharon turned up the heat all through the top reaches of the Reagan administration. He was close to a fellow former general, Secretary of State Alexander M. Haig Jr., and soon Haig was transmitting Sharon's wishes.

Inman lost the battle. President Reagan signed a top-secret order, called a "finding," that authorized the $10 million in covert aid to Gemayel's militia.Israel Invades on a Pretense

A few months later, in the spring of 1982, Casey met again with Sharon, who was in Washington making the rounds. Sharon talked about countermoves in Lebanon; if the PLO strikes here, Israel will strike there. "Lebanon," Sharon said, his tone dripping sarcasm, as if the country were a geographic fiction. "Don't be surprised. Let's get the cards on the table. If you don't do something, we will. We won't tolerate it."

Casey understood that Lebanon was the one Arab state where Israel could extend its influence, and he concluded that Sharon wanted to create circumstances that would justify an Israeli military move.

Casey appreciated Sharon's style, seeing him as both an activist and a thinker, a man who had a sense both of his country's vulnerability and its destiny. It was also clear that Sharon had Israeli Prime Minister Menachem Begin mesmerized. Sharon was calling the shots.

On June 6, 1982, Israel invaded Lebanon, citing as justification the attempted assassination of its ambassador to London three days earlier. Israeli intelligence, the CIA and soon the British knew that this stated reason was bogus. The Israeli ambassador's assailants were part of the Abu Nidal faction that was at war with the mainline PLO.

At CIA headquarters in Langley, Casey convened a meeting in his office. One question was whether Israel was using U.S.-supplied weapons, and many at the meeting voiced concern that the United States would be seen as an accomplice and Congress would raise questions. "I don't give a {expletive} about that," Casey said. "The situation is fluid. Anything can happen. How do we turn this to our national interest? That's the question I want answered."

In the weeks after the invasion, there were indications that Bashir Gemayel was headed for the presidency of Lebanon. He had eliminated his competition among the Christian factions. His good relations with the invading Israelis gave him a lever. The pro-Israeli elements in Lebanon looked on Gemayel as the new light; the anti-Israeli elements (Moslems and leftist Druze led by Walid Jumblatt) considered him the only person who might be able to get the Israelis to withdraw. Bashir Gemayel had become the rallying point.

Now, instead of seeking to expand the CIA's use of Gemayel, Casey moved to sever it. Since the 1977 public disclosure that King Hussein of Jordan had been a CIA-paid agent for 20 years, the agency had been reluctant to keep heads of state on the payroll. As Gemayel was thrust more into the limelight, exposure of his CIA connections could end his career, if not his life. The relationship was one of the CIA's most guarded secrets. Everything was being done to protect it.

On Aug. 23, 1982, 2 1/2 months after the Israeli invasion, Bashir Gemayel was elected president of Lebanon. He was to take office the next month. The few who knew about the recently severed CIA relationship could feel only a mixture of joy and horror. Lebanon was a country of no permanent friends, no permanent enemies. The very things that made Gemayel the likely leader left him with numerous enemies. The Moslems were fortified by the rise of Ayatollah Ruhollah Khomeini in Iran; the well-financed PLO still had a presence in Lebanon, though the evacuation from Beirut of 11,000 PLO fighters, including PLO Chairman Yasser Arafat, had begun.

A Lebanon under Bashir Gemayel, strategically allied with Israel and the United States, would upset the regional balance of power. Powerful Syria to the north and east had occupied the Bekaa Valley in Lebanon since 1976 and, in fact, considered all of Lebanon part of "greater Syria." Syria's Soviet allies were also unhappy with the prospect of Lebanon under such strong Israeli influence.

Faced with this array of internal and external enemies, Gemayel passed a message to the CIA requesting a new relationship: He wanted to be provided with security and intelligence assistance. Casey felt the CIA had an obligation to help Gemayel, but it could not be done openly. A large-scale covert operation was necessary. To be effective, the CIA would have to become more closely involved with the Lebanese intelligence service. It would have to share sophisticated weapons as well as equipment for electronic surveillance, and communications.

President Reagan approved a finding for the operation that called for an initial expenditure of about $600,000. It was projected to grow quickly to more than $2 million a year, perhaps as much as $4 million.

On the afternoon of Sept. 14, 1982, nine days before he was to take office, Gemayel was speaking at the local office of his Phalangist Party in East Beirut. He was scheduled to meet at 5 p.m. with a group of Israeli intelligence officers touring the city. At 4:10, a bomb detonated, bringing the building down and killing him.

The CIA had not had time to get its covert-assistance program into play. There was no evidence that the CIA relationship had leaked. Still, it was a disaster for the CIA to have a former asset assassinated.

The assassination was the first in a chain of calamitous events. Within two days, Israeli forces allowed Phalangist units to enter Palestinian refugee camps in Beirut on a mission of revenge. The names of two of those camps, Sabra and Shatilla, have since become part of the history of massacre. Israeli intelligence calculated that there were 700 to 800 Palestinian victims, many of them women and children.

Within two weeks, U.S. Marines were stationed at a strategic location in barracks near the Beirut airport. As part of a joint peacekeeping mission, they had no specific goal other than to assist Lebanon and oversee the eventual withdrawal of foreign troops.

Israel's intelligence service, the Mossad, and its military intelligence agency began inquiries to determine who had killed Gemayel. They traced the bomb to a 26-year-old member of a rival party of the Phalangists, whose "operator," or case officer, was a captain in the Syrian intelligence service. The Israelis established that the captain reported directly to the lieutenant colonel in charge of Syrian intelligence operations in Lebanon.

The Israelis believed that Syrian President Hafez Assad had such an iron grip on his country that he had to have known that such a plan was under way. But there was no proof, and the intelligence reports showing the alleged complicity of the Syrian intelligence officers were highly classified.

Casey saw these reports of Syria's alleged involvement, which were provided by Israeli intelligence. They were convincing enough, and they fit with his own analysis. It was necessary to consider who benefited most from Gemayel's death. Who wanted a weak Lebanon? Who most feared a strong tie between Israel and Lebanon? The answer was Syria. Still, in the end, Casey had to accept the unwillingness of the White House and the State Department to publicize a Syrian role.

Casey had an intelligence failure on his hands. The CIA relationship with Gemayel, the decision to break it off, Gemayel's request for protection, the administration's decision to grant it and the subsequent assassination -- this was a mess. But it was a highly classified mess. It stayed secret. Top Aide Bypassed on Contras

The several million dollars allocated for the never-launched Gemayel security operation was put into a special presidential contingency fund for covert operations. This "put and take" fund of about $50 million was always available in an emergency, or when Congress was not in session. After the emergency, or when Congress reconvened, the money would be authorized and the fund replenished.

In 1983, the CIA was running out of funds for the Nicaraguan contras, who were receiving CIA aid in their fight against the Sandinista government. Casey decided to reprogram the money left from the Gemayel operation. But there was a delay of weeks before the paper work arrived at the Senate Select Committee on Intelligence, informing it of the transfer.

Given the mounting sensitivities and skepticism about the contra operation within the committee, the delay in giving this routine notification renewed feelings that the CIA was not leveling with its congressional overseers. Some Democrats saw it as an opportunity to string up Casey.

But the record showed that Casey had been out of town at the time of the disbursement. It was Casey's new deputy, John N. McMahon (who had replaced Inman) who had not notified the committee promptly. The Democrats hunting for Casey's scalp had come up with McMahon's instead.

This was almost too good to be true for the conservative Republicans on the committee, who saw McMahon as fundamentally anticontra and too cautious. McMahon had to explain his slip to each of the key senators. In the course of this, he realized he was not up to speed on the Nicaragua operation. Contra support, training or arms interdiction efforts were under way in Guatemala, Costa Rica, El Salvador, Honduras and Panama. He had not realized the magnitude of Casey's undertakings. McMahon was the deputy director and he had been bypassed. The situation was intolerable.

McMahon protested to Casey that he could function as a deputy only if he was in the loop. There could be no repeat of the experience with Inman, who had quit in part because he had been cut out of the contra operation. Neither Casey nor McMahon wanted that. Casey stared and then agreed; new procedures were established to include McMahon fully.

Seeing more of the expanding contra war only increased McMahon's unease. In his best I-am-loyal-to-you style, he suggested that they could find another way to handle it. Perhaps now that the operation was in the open, it belonged in the hands of the Defense Department? It did, after all, have the appearance of war.

Casey didn't like the idea. If the CIA couldn't handle the tough assignments, if it had to shuffle them off to the military, the CIA's paramilitary capability -- which he had vowed to restore -- would be a joke. These operations were the hard calls. Besides, the military didn't have the stomach for such an operation. And a superpower could not take on a pipsqueak nation like Nicaragua with a frontal military assault.

McMahon argued passionately, insisting that he was on Casey's side. He had been there in the 1970s, he had experienced first-hand the congressional investigations into covert actions, the low morale, the crack-up and the crippling of the agency that had occurred before Casey took over.

Casey suggested that they both talk to others on the National Security Council. The idea of passing the contra operation to the Defense Department was presented to Defense Secretary Caspar W. Weinberger, national security adviser William P. Clark and Secretary of State George P. Shultz.

Weinberger's response was simple: over his dead body. He was determined to keep the military out of anything that did not have the full backing of Congress and the public. And this operation already smelled of no confidence.

Shultz said he found the covert approach manageable on the diplomatic front. Covert action was deniable; a Pentagon program would not be.

Clark agreed that the operation was best in the hands of the CIA.

President Reagan was effusive. "Bill and the CIA are doing the right thing," he said.

The Nicaragua operation was with the CIA to stay.

NEXT: Recruiting spies

Barbara Feinman, of The Washington Post, was research assistant for "VEIL: The Secret Wars of the CIA, 1981-1987."

1987 by Bob Woodward, published by Simon and Schuster Inc. All rights reserved.