Even before he ordered the bombing of Libya in 1986, President Reagan knew he had public support behind him. It wasn't a gut feeling on the part of the Great Communicator. He knew because the administration had commissioned a poll that indicated the majority of Americans were finally ready to strike back against terrorism.

In an unprecedented move, Reagan's National Security Council paid for such polls in the pivotal year of 1986 to help it shape foreign policy.

Using these secret polls, the NSC was able to track public antagonism toward Libya to such a fine degree that the officials in the White House knew when the majority of Americans had swung over in favor of retaliation. That happened in March 1986. U.S. planes bombed Libya on April 14.

The polls, done for the NSC by private pollsters, were reported to the NSC Crisis Management Center in a series of four quarterly reports. The subjects treated in those polls, according to the first report, were ''considered germane to the current national security interests of the United States and hence to the NSC and CMC for presidential decision-making in policy formation and crisis management.''

Terrorism, and the public reaction to it, was included in each report. The key question was always whether the public would support a military attack on state-sponsored terrorism.

The president was particularly interested in Libya. He had isolated it as the chief source of terrorism after attacks on the Rome and Vienna airports in December 1985. Iran and Syria were in on the planning, too, but Reagan was secretly negotiating with those two countries.

On Jan. 11 and 12, 1986, according to the private reports to the NSC, Reagan's pollster, Richard Wirthlin, conducted a confidential poll asking whether the public would support a military strike against a state that supported terrorism. Forty-nine percent said yes.

Between March 8 and 11, the NSC, through a Washington think tank, polled 1,500 adults by telephone throughout the nation and asked them 50 questions, some on terrorism and Libya. Sixty-six percent were now ready for military action.

The report to the NSC even spelled out the ground rules. To receive public support, the report said, an attack would have to be ''reluctant,'' not resulting from anything we did to provoke the terrorism. It would have to be focused on the bad guys, would have to be perceived as necessary because nothing else had worked, and the action would have to be limited and defensive. In addition, the report said, it would be beneficial if other nations helped, and if the administration appeared publicly united on the military operation.

On March 23, less than two weeks after the poll was taken, Libya fired antiaircraft missiles at American warplanes in the Mediterranean. On April 5, a bomb exploded in a West Berlin discothe'que, killing two people, including an American serviceman. Reagan immediately fingered Libya as the villain. (West Germans and others have since expressed serious doubts about the extent of Libyan culpability.)

In a nationally televised news conference, Reagan called Libyan President Moammar Gadhafi ''this mad dog of the Middle East.''

On April 14, American planes took off from British bases and bombed ''terrorist-related targets'' in Tripoli and Benghazi, Libya.

The NSC's private pollsters, in their June report, said they were not surprised by the overwhelming public support. But they warned that it would be typical for the public to change its mind as time went on.

So, in their June survey, the NSC's pollsters tried to find out whether the bombing had received ''sustained public support.'' The poll revealed a 75 percent rate of approval -- the same as various media polls indicated when the action was first taken.

The report concluded: ''Not only has the popularity of the raid lasted with the American public, but its effect has been to raise the president's overall job rating higher than it has ever been before, as measured in the Gallup Poll.''