The United States spent millions of dollars in recent years to help ensure the personal safety of Egypt's slain president, Anwar Sadat. Outlays ranged from former president Richard Nixon's gift of a $2 million armor-plated presidential helicopter to recent escorts by sophisticated AWACS radar planes for Sadat's out-of-country journeys.

In addition, last year's CIA budget included funds for an elaborate communications system to protect members of Sadat's private security force from interception by other police or military agencies, according to congressional and intelligence sources. The CIA's installation of this system in Egypt had been a closely held secret, one intelligence official said, out of fear that other countries would press American officials to provide them with the same system.

U.S. officials also trained Sadat's security forces in Secret Service-style methods of crowd control, defensive tactics and intelligence-gathering related to assassination plots.

Private American security firms had been consulted in the last two years on how to better protect Sadat with bulletproof clothing (which he refused to wear), the use of polygraph equipment for random checks of staff loyalty, and explosives-detection for parades and other public functions.

These expensive and sophisticated precautions, however, were unable to save Sadat Tuesday from assassins' bullets and shrapnel. U.S. intelligence officials were studying details of the attack to determine how the assassins were able to close on Sadat's position so rapidly with continuous firing before the presidential security guards responded.

One intelligence official said it could not be determined from reports thus far whether the guards were stunned by a concussion grenade that rendered them momentarily senseless. The official pointed out that the Egyptian presidential security force has had less experience with actual attacks on its president than American Secret Service forces in recent years and, therefore, might not be expected to respond as quickly.

Even if Sadat had been wearing protective clothing, one intelligence official said, the destructive force of multiple bullet and shrapnel wounds at point-blank range would have surpassed its ability to protect the 62-year-old leader.

The official added that "Sadat took his personal badge of courage a long way. He exposed himself. It was part of the man's mystique."

A former high-ranking American military official who discussed Sadat's security needs with his top aides two years ago said yesterday that "I was not impressed with them." This man, whose private security firm has sold protection systems to President Ferdinand Marcos of the Philippines, said that Egyptian officials turned down his suggestion that Sadat's guards be given unannounced polygraph tests to flush out potential plotters.

The U.S. security expenditures, which congressional and military sources were unable to tally with any precision, were considered vital by succeeding administrations because of Sadat's unique role in the Mideast peace process. The intelligence official put the total expenditures for Sadat's security over the years at $20 million or $25 million.

During his August state visit to the United States, Sadat himself made reference to the security measures afforded him by the United States. On NBC's "Meet the Press," Sadat responded to a question about the need to provide Airborne Warning and Control System (AWACS) planes to Saudi Arabia by saying:

". . . You shouldn't leave the Saudis like a sitting duck, blind and not knowing what is happening around them. Me, too. At some time I found it necessary and I called the American ambassador, before my trip to Sudan, and I wanted to know what is happening in Libya and in Sudan and in Chad. . . where I am going to visit.

"So I asked him to provide me with one of the AWACS to tell me and we borrowed one from Saudi Arabia. Your administration sent it to me . . . to do the monitoring and to let me know what is happening around me."

Nixon, during his final days in office, visited Egypt where he and Sadat were ferried around Cairo in one of the familiar Sikorsky Ch53E helicopters of the presidential fleet. Sadat was reportedly so taken with the quietness of the ride in the armored craft that Nixon offered to give him the helicopter they were riding in.

The gift caused something of a flap when Nixon returned and congressional officials learned of it. Administration official fretted for months on how to charge off the $2 million expenditure. Eventually, according to congressional sources, the item was charged against the Food For Peace program.