Two months and 10 days into his presidency, Ronald Reagan was shot by John W. Hinckley Jr. The bullet, lodged about an inch from his heart, was removed during surgery. "Honey, I forgot to duck," he told his wife, Nancy, and to his doctors he quipped, "Please tell me you're Republicans."

His display of courage and optimism won universal praise. When Reagan left the hospital on April 11, 1981, after a two-week stay, cameras were allowed in close to record the almost miraculous recovery of this 70-year-old president. Though slightly thinner in the face, he emerged cheerful, wearing a red cardigan sweater. He and Nancy had an arm around each other, their other arms high in the air, just as on that night nine months earlier, on a raised platform, when Reagan had accepted the Republican presidential nomination. The famous smile was intact, as was the presidency.

Reagan's closest advisers soon learned it was an act. The next morning the president limped from his bedroom to an adjoining room in the upstairs residence of the White House. He emerged slowly, walking with the hesitant steps of an old man. He was pale and disoriented. Those who observed were frightened. Reagan hobbled to a seat in the Yellow Oval Room, started to sit down and fell the rest of the way, collapsing into his chair.

He spoke a few words in a raspy whisper and then had to stop to catch his breath. He looked lost. The pause wasn't enough and his hands reached for an inhaler, a large masklike breathing device next to his chair. As he sucked in oxygen, the room was filled with a wheezing sound.

Reagan could concentrate for only a few minutes at a time, then he faded mentally and physically, his wounded lung dependent on the inhaler. During the following days, he was able to work or remain attentive only an hour or so a day.

The few who were granted access to the president were gravely concerned. This was supposed to be the beginning of the Reagan presidency, but at moments it seemed the end of the Reagan they knew. At times the president was overcome with pain; he seemed in constant discomfort. His hearty, reassuring voice sounded permanently injured, his words gravelly and uncertain. His aides began to consider the possibility that his was going to be a crippled presidency -- that it would, at its very beginning, devolve into something similar to Woodrow Wilson's at the end, a caretaker presidency, and that they would be reduced, or elevated, to a team of Mrs. Wilsons.

The senior aides were intent on protecting this terrible secret and their own uncertainty, at least until the prognosis was clearer. Those with intelligence or law enforcement responsibility, such as CIA Director William J. Casey, were reminded of the vulnerability of the presidency, the necessity to take every extra measure of security to protect the country and its institutions. The precariousness of the world situation seemed clear enough. These men sensed that more than the president had been wounded.

On the day of the shooting, March 30, 1981, many things had gone haywire, exposing weaknesses in people and systems in the administration. Asked on live television, "Who's running the government right now?" White House spokesman Larry Speakes had flubbed, "I cannot answer that question at this time." Secretary of State Alexander M. Haig Jr., watching this shaky performance in the Situation Room, had marched before the cameras and misread the Constitution, placing himself after the vice president, who was not in Washington, in the chain of presidential succession. He added, "As of now, I am in control here, in the White House."

At the hospital, the president's military aide, the emergency-war-orders officer who carried the codes and orders that might be used by a president to launch nuclear weapons, had fought a losing battle with the Federal Bureau of Investigation over Reagan's possessions and clothes, which the FBI had seized as possible evidence. The FBI had carried off the president's secret personal code card, which he kept in his wallet. The card provides a code that can be used to authenticate nuclear-strike orders in an emergency, should the president have to use unsecure voice communication to the military. Officials insisted there was no loss of control over U.S. nuclear forces, but the confusion pointed to a weakness in fail-safe management of nuclear weapons.

There was a feeling of executive disorientation in the White House, and the president's shaky condition only heightened it. But slowly, Reagan's voice returned, and he had periods that suggested he was on the road back. Ten days of rest in the White House residence helped, and on April 21 he spoke on a radio talk show to lobby for his spending and tax-cut plans. The next day he granted an interview to the senior wire service reporters and seemed fine. But he had no endurance, and his aides still worried.

On Saturday, April 25, the Reagans went to Camp David for the weekend. The spring days at the mountain retreat were just the right cure. When the president returned to Washington, he had snapped back and the perceived crisis in the White House abated. But the people who had seen or knew remained on edge.

The Reagan presidency, from the inside, would never be the same. That sense of peril, that anyone or anything might strike -- terrorists, a quick move by the Soviets, other adversaries -- became a permanent, enduring influence on administration policy.

Nowhere was this more true, or more deeply felt, than in the office of the director of central intelligence. Protecting the president was not a part of the job that Casey had anticipated, but whenever an intelligence report was received about some plot against Reagan -- however bizarre or improbable -- Casey followed up. The operations people and the analysts often responded that such reports were not to be taken seriously and generally amounted to nothing more than two guys in a bar in Tanzania saying they would like to shoot Reagan.

"I want a team on it," Casey ordered after each report.Gadhafi's Loose Talk

Four months later, about 7 a.m. on Wednesday, Aug. 19, 1981, Libyan air force jets attacked two U.S. Navy F14 fighters on dawn patrol more than 30 miles inside the territorial waters claimed by the Libyan leader, Col. Moammar Gadhafi. Under instructions to defend themselves, the U.S. planes retaliated and shot down two of Gadhafi's jets.

Three days later, Gadhafi was in Ethiopia's ancient capital, Addis Ababa, meeting with that country's leader, Lt. Col. Mengistu Haile Mariam, a young, fiery Marxist. In the room at the time was a senior Ethiopian official, a secret Central Intelligence Agency source of such sensitivity that his reports went only to a select group of key people granted access to sensitive intelligence from human sources. The CIA's Directorate of Operations evaluated him as "generally reliable" to "excellent."

At that meeting, Gadhafi declared he was going to have President Reagan killed, the Ethopian official reported. When that report reached Washington, it carried this evaluation: "Mengistu was convinced Gadhafi is very serious in his intention and that the threat should be taken seriously."

Shortly afterward, the National Security Agency intercepted one of Gadhafi's conversations in which he essentially made the same threat. Casey realized that this was about as good as intelligence ever got -- an intercept and a human-source report that his own Operations Directorate said should be taken "seriously." Other than a military attack, the warning was perhaps the most serious matter he might ever address, a threat to the life of the president. Action had to be taken. But what? They couldn't go and shoot Gadhafi.

A week passed without an attempt on the president's life. Everyone seemed to cool off -- but not Casey. He ordered all the intelligence agencies to report any whisper to him directly.

About that time, in late August, a CIA European source reported that a key Palestinian had conferred with a member of the Libyan General Staff and had agreed to a joint action against Reagan. A report from another high-level Palestinian said that the shadowy group Black September had been reactivated to move against U.S. and Israeli targets.

In early September 1981, an unidentified relative of a Libyan diplomat in New Delhi wrote a letter to the U.S. Embassy there saying that Libya planned to assassinate Reagan. It was a fragment, untested and unexpected. Was it a cry of conscience that should be taken seriously? Casey thought that even unlikely sources deserved attention until their information could be discounted.

Next, "a casual informant with excellent access to senior Libyan military officers" delivered two intelligence reports: one, that Libya was preparing to attack American interests in the Mediterranean area; the other, that Libyans in Rome were preparing to kidnap or murder the U.S. ambassador to Italy, Maxwell M. Rabb.

On Sept. 9, a European intelligence service reported that the Italians had arrested and expelled a number of Libyans believed to be involved in a plot against Rabb. A week later this same intelligence service confirmed that a Palestinian group had agreed to assist Libya in attacking Reagan and other American targets.

On Sept. 19, another classified intelligence report stated that Libya would launch a suicide attack against the aircraft carrier USS Nimitz, which was off the coast of Libya in the Mediterranean.

On Oct. 9, there was a report from a European intelligence service that Gadhafi was in Syria and had met with four key terrorist groups to enlist their support in attacking U.S. targets in Europe.

On Oct. 17, "an informant with demonstrated access to senior Libyan intelligence personnel" reported that Libyans had left for Europe to engage in attacks on U.S. embassies in Paris and Rome. Within a week, there was a report from a CIA source with access to Libyan intelligence officers that five Libyans, possibly members of a hit team, had arrived in Rome.

On Oct. 30, the Italian intelligence service, SISMI, told the CIA that the team had passed through Rome and gone on to an unknown destination.

On Nov. 12, a gunman fired six shots at the U.S. charge' d'affaires in Paris, Christian A. Chapman. He narrowly escaped injury. The CIA believed Libya was behind the attack.

On Nov. 16, an informant walked into a CIA station at a U.S. embassy abroad, claiming he had left one of Gadhafi's training camps. He gave detailed descriptions of their training exercises -- how, for example, to hit an American limousine caravan. The informant passed polygraph tests.

This informant added that if President Reagan proved too difficult a target, the Libyans were to go after Vice President Bush, Secretary of State Haig or Secretary of Defense Caspar W. Weinberger as "potential alternate targets."

Faced with more than a dozen intelligence reports, Casey felt Gadhafi's enterprises, assertions and promises had to be countered. Any adventure within U.S. borders had to be thwarted at almost any cost, at once. Casey inundated the White House with this information. He wasn't going to be caught napping. Better too much than too little.

Reagan's White House aides ordered a stepped-up security effort, including the dispatching of decoy limousine caravans about Washington while Reagan traveled less conspicuously in another caravan. Ground-to-air missiles were stationed next to the White House.

The Immigration and Naturalization Service sent a seven-page memo stamped EXTREMELY SENSITIVE to its major border-crossing and airport offices. Composite sketches of five of the alleged hit men soon were leaked and the sketches appeared on television news shows, a major disclosure that gave credence publicly to the threat.

At a top-secret Nov. 30 National Security Planning Group meeting, the key national security gathering of top Reagan advisers, the president asked that plans be developed for "a military response against Libya in the event of a further Libyan attempt to assassinate American officials or attack U.S. facilities." A long TOP SECRET memo on "counterterrorist planning toward Libya" was drafted for Reagan on Dec. 5 by Haig, Deputy Defense Secretary Frank C. Carlucci (standing in for Weinberger) and Casey.

A TOP SECRET chart listed five "graduated responses." First, a direct attack on terrorist training sites in Libya. The second contingency was a strike at Gadhafi's airfields; the third, a strike on his naval facilities; the fourth, on his military equipment stockpiles, and the fifth, an attack on naval vessels in port, using special Navy SEAL (sea-air-land) teams.

Meanwhile, the threat of possible Libyan hit squads had become so public that Gadhafi appeared in a live television interview Dec. 6 to deny that he had sent anyone to assassinate the president or anyone else. But his eyeball-to-eyeball with the news media convinced no one in the administration and the president secretly sent a direct threat to Gadhafi -- through Belgium, because the United States and Libya had no diplomatic relations.

"I have detailed and verified information about several Libyan-sponsored plans and attempts to assassinate U.S. government officials and attack U.S. facilities both in the U.S. and abroad," the president said in the TOP SECRET EYES ONLY message.

The warning seemed to work. Within the next week, a senior Libyan intelligence official came to the United States as an envoy and said that Gadhafi was "desperate" to open a channel to the United States and pledged there would be no terrorist or assassination operation.

On Dec. 18, the CIA Intelligence Directorate issued a SECRET report that assessed the credibility of the earlier intelligence. "Subsequent reports on actual plans to carry out attacks against senior U.S. government officials, however, have come from sources with only indirect access, whose credibility is open to question. It is possible that some of the reporting may have been generated because informants are aware we are seeking this information."

A later SECRET State Department analysis from the department's intelligence division raised similar concerns after reviewing CIA records. " . . . the source of one of the reports that Libya intends to attack the Sixth Fleet has in the past sustained contact with a Soviet diplomat." The analysis also said that most of the other reports of plans to attack U.S. officials were "later discounted" and it noted "the obvious probability that reporting breeds reporting where the U.S. is perceived to have an interest." In all, the memo suggested that all the hit-squad reports may have been misinformation feeding off itself.

Much of this latter information was traced to a shadowy figure with ties to the Iranian and Israeli intelligence services -- Manucher Ghorbanifar, a wealthy Iranian arms salesman who also had been a secret CIA source since 1974. He had seen the initial hit-squad reports as an opportunity to make trouble for the Libyans, and he singlehandedly kept the issue alive for several months.

The CIA later determined that Ghorbanifar's information not only was wrong but had been intentionally fabricated. In 1983, the agency terminated his relationship as a source. In 1984, it issued a formal "burn notice," warning that he was a "talented fabricator."

(Nonetheless, in 1985, Casey approved the use of Ghorbanifar as a key intermediary in the secret U.S.-Iran arms sales. Casey was alert to the danger, but Ghorbanifar was the sort of person who often became an intelligence asset; sleaze was no barrier to usefulness.) An Intelligence Coup

On Jan. 27, 1982, in a television interview, President Reagan was asked if the hit-squad reports were untrue.

"No," Reagan responded. "We had too much information from too many sources, and we had our facts straight. We tried to sit on them. We tried to keep that all quiet . . . but our information was valid."

During the next four years, Casey and the administration remained obsessed with Gadhafi and his activities. In March 1986, Casey's people pulled off a spectacular intelligence coup: They began regularly intercepting messages from Gadhafi's intelligence headquarters in downtown Tripoli. The exact method was a closely guarded secret, but by one count, they received and decoded 388 messages. One three-line message, sent March 25 to eight of the Libyan People's Bureaus -- the Libyan equivalent of embassies -- instructed them to stand by to execute the "plan."

In the early hours of April 5, another intercepted message from East Berlin to Tripoli reported that an operation was "happening now" and would not be traceable to the Libyans in East Berlin. Within 10 minutes, at 1:49 a.m. Berlin time, a bomb detonated at the LaBelle discotheque in West Berlin -- a known congregation point for off-duty American military personnel. The explosion killed one U.S. serviceman and a Turkish woman, and injured 230.

Casey now had his smoking gun. Though the individual messages might be somewhat ambiguous, taken together they provided the elements his intelligence analysts considered crucial. Secret planning for a retaliatory military raid began.

On Monday, April 14, 1986, 30 U.S. bombers attacked Gadhafi's personal compound and other targets. In a television address from the Oval Office two hours after the raid, President Reagan said: "Today we have done what we had to do. If necessary, we shall do it again."

NEXT: An asset in Lebanon

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.