President Mohammed Anwar Sadat, the Egyptian leader who sought to end three decades of Arab-Israeli warfare and to make Egypt a secure ally of the United States, was killed today by a hail of bullets fired by soldiers who attacked his reviewing stand during a military parade celebrating Egypt's bold crossing of the Suez Canal in 1973.

Vice President Hosni Mubarak, who immediately succeeded Sadat as the effective ruler of the country, announced Sadat's death shortly before 8 p.m. in Cairo (2 p.m. EDT) and declared that Egypt would honor all of the agreements made by Sadat, presumably including the 1978 peace treaty negotiated with Israel at Camp David.

Three of the Egyptian soldiers who assassinated Sadat were reportedly killed on the parade grounds in the Cairo suburb of Nasr City, where the attack occurred. At least three others were reported to have been captured, but there was no indication from Egyptian authorities late tonight that they had discovered the reasons behind the assassination plot.

Eight other persons on the reviewing stand, including government officials and foreign diplomats, were killed in the attack, according to police sources, and 27 others were injured.

Visibly bleeding but apparently still alive, the 62-year-old Egyptian leader was rushed by helicopter from the parade grounds to a military hospital at Maadi, across the capital.

Sadat arrived at Maadi at 1:20 p.m. (7:20 a.m. EDT) in a coma with no detectable heartbeat, blood gushing from his mouth, a medical bulletin released by the hospital said.

The bulletin said Sadat's wounds included two holes in the left side of his chest, a bullet in the neck just above the right collar bone, a wound above the right knee, a huge gash at the back of the left thigh and a complicated fracture of the thigh.

Doctors tried desperately to save the president's life by administering artificial respirating, heart massage, blood transfusions and injections directly into the heart. An hour and 20 minutes later, when the heart had still not responded, and no brain activity could be detected, the doctors pronounced Sadat dead.

The government later announced that the funeral will take place Saturday, the third day of the Moslem religious Festival of the Sacrifice (Eid el Adha).

There were conflicting initial reports on the affiliation of the assailants, believed to have numbered six, who were dressed in Egyptian Army uniforms. Anonymous telephone-callers to news agencies in Beirut said that an extremist Egyptian exile group linked to Libyan leader Muammar Qaddafi claimed credit for the shooting. But unofficial Army sources said they believed the attackers, were part of a rightist Moslem organization that was a target of a major government crackdown last month.

The government made no comment on the identity of the assailants.

Sadat's death seemed certain to have major repercussions not only inside a shaken Egypt but throughout the Middle East.

Awarded the Nobel Peace Prize for his historic 1977 trip to Jerusalem and subsequent treaty with Israel, Sadat had single-handedly turned the course of Egyptian politics away from war and toward peace with Cairo's No. 1 enemy.

Israeli Prime Minister Menachem Begin, in Jerusalem, emotionally mourned the loss of "one of the great fighters for peace in our generation," and public statements of shock and sadness poured from Western capitals. In Washington, President Reagan said that "America has lost a close friend. The world has lost a great statesman, and mankind has lost a champion of peace."

Sadat's peace-making with Israel, however, had turned most of the radical Arab and Islamic world bitterly against him, and from Iran to Libya his death was hailed as righteous vengeance against a traitor.

In a calm and somber speech to the nation, recorded following an emergency Cabinet meeting, Mubarak, 53, said that Sufi Abu Taleb, speaker of the National Assembly, would serve as interim president until elections to be held within 60 days, as stipulated by the Egyptian Constitution. Mubarak was named chief of staff of the armed forces, and was immediately nominated by the ruling National Democratic Party as its presidential candidate.

Mubarak called Sadat "a martyr to peace" and pledged the Egyptian government would abide by all the treaties and agreements entered into during his 11-year presidency, presumably including the peace agreement with Israel and the U.S.-sponsored Camp David accords.

"We tell Sadat," Mubarak said, "your people will always remember you, will never forget you."

Taleb declared a year-long-state of emergency today. The capital was largely quiet and there were few visible signs of disturbance or even mourning following the announcement.

But the repercussions of the assassination inside Egypt are likely to be far-reaching in this system of limited democracy, which already was being severely tested both by leftist and Moslem fundamentalist opposition groups. Last month, Sadat had ordered the arrest of more than a thousand people in a massive crackdown on sectarian extremists and secular opposition elements to his regime. Nonetheless, Mubarak said that Egypt would continue to remain "an island of peace and stability" in the Middle East.

The others killed in the attack included Sadat's private secretary, Fawzi Abdel Hafez; chief chamberlain, Hassan Allam; his official photographer, Mohammed Rashwan; Bishop Samuel, leader of the Coptic Christian Church of Egypt; one Omani delegate to the parade; three other unidentified persons, one of them a security guard.

Sadat had appointed Bishop Samuel only last month to a committee replacing Pope Shenuda III as patriarch of the Christian Coptic church.

Among the identified wounded were seven Egyptians, four Americans, and the Belgian ambassador.

AU.S. Embassy spokesman identified the four Americans as Air Force Capt. Christopher Ryan, of Sacramento, Calif., stationed at the U.S. European Command; Marine Maj. Gerald R. Agenbroad, of Bruneau, Idaho, of the Rapid Deployment Force Command; Air Force Lt. Col. Charles D. Loney of Austin, Tex., who is normally stationed at Air Force headquarters in Washington and Richard McCleskey, an employe of the Raytheon Corp.

Spokeman said the three military men were on visits here and that none of the injured Americans was in serious danger.

The condition of the other wounded was not immediately known.

Neither Mubarak nor Defense Minister Abdel Halim Abu Ghazala, both of whom were seated near Sadat on the reviewing stand, was injured in the attack, which took place at approximately 1 p.m. local time (7 a.m. EDT).

Sadat was first reported to be only slightly injured although several eyewitnesses told diplomats they saw blood on his face as he was whisked away from the parade ground even before the shooting was over.

He was taken by helicopter to the Maadi Army hospital, where the former shah of Iran, Mohammad Reza Pahlavi, died a little over a year ago.

An official government statement said Sadat was wounded and was receiving medical treatment "at the hands of a group of specialists" working under the personal supervision of Mubarak.

Shortly after that announcement, Egyptian television began a special program of readings from the Koran. Until Mubarak's televised statement, the government had said nothing about the president's condition, although foreign radio stations had long since begun disseminating news of his death.

The initial official government statement said the shooting had occurred about 12:40 p.m. local time (6:40 a.m. EDT), although witnesses to the assassination put the attack closer to 1 p.m. local time.

During the two-hour military spectacular, Sadat had appeared relaxed, even jovial and was seen at times smoking his pipe. There was no indication he expected any trouble to occur during the parade, which marked the eighth anniversary of the initial Egyptian offensive during the war in 1973 in which Israel eventually defeated Egypt.

The assailants, either civilians dressed in military uniform or regular soldiers, were riding in a Soviet-made truck that was towing a new South Korean long-range artillery piece. There were six of them sitting in the back of the open-sided vehicle, though some eyewitnesses thought there were a total of eight involved in the attack.

As the truck drew up parallel to the reviewing stand at about 15 yards' distance, it came to an abrupt halt.

Few of the approximately 2,000 spectators, invited guests including Egyptian and foreign officials as well as journalists, in the reviewing stands took note of the stalled truck because all eyes were riveted on a spectacular aerobatic show in which Egyptian Mirages were making low passes over the reviewing stand and leaving behind billowing trails of red, white and blue smoke.

Suddenly, there was an explosion, sounding like a grenade, and then another as the soldiers in the ostensibly stalled truck opened fire with automatic rifles directly on the reviewing stand. Several of the soldiers jumped off the back of the truck and rushed toward the stand, firing wildly into the crowd.

Sadat and other members of his party could be seen diving helter-skelter for the ground, while security men rushed to cover the president's body and take him away through a door directly behind the stand. But it appeared that the soldiers standing in the truck were high enough up to continue pouring their gunfire into the reviewing box.

The newspaper Al Akhbar, in its early Wednesday edition, printed a photograph of two of the assailants standing at the edge of the viewing stand and firing at virtually point-blank range into the official box. The picture shows a pile of chairs heaped around the seat where Sadat had been sitting, apparently being used by aides as shields. Two other assailants can be seen running nearby, on the tarmac on which the truck stopped.

As spectators suddenly realized that what was taking place was not another parade stunt, pandemonium broke out in the viewing stands. Spectators rushed for the exits to escape the bullets, some of which were flying high above the box.

The entire incident seemed to last no longer than several minutes, but the vast number of security men around the reviweing stands were slow to react, giving the assailants ample time to shoot and throw several grenades. At least two and possibly three explosions were heard in the ensuing chaos of screaming voices and gunshots.

Unofficial Army sources here said they believed the assassins were part of the Gamaat Islamiya, or "Islamic Groups," a right-wing Moslem organization that was a major target of Sadat's crackdown.

The majority of the more than 1,500 persons detained were fundamentalists but there also were Christian extremists and leftist elements who had been increasingly critical of his peace treaty with Israel and his close alliance with the United States. The Army sources said that preliminary interrogation of the surviving members of the assassination squad led them to believe that the right-wing Moslem fundamentalists were behind the action.

Meanwhile, in Beirut, several Western news agencies and the leftist newspaper Al Liwa all reported receiving calls from an anonymous Arab male, speaking in an Egyptian accent, who claimed the assassination was the work of a little-known Egyptian opposition group based abroad.

The group is known as the Independent Organization for the Liberation of Egypt, or the Egyptian National Front, which is led by retired Egyptian Lt. Gen. Saadeddin Shazli, who was chief of staff during the 1973 war.

Al Liwa told The Associated Press in Beirut that the caller claimed the military wing of the National Front, which he identified as the Rejection Front for the Liberation of Arab Egypt, was reponsible for the attack.

If Shazli's group was indeed involved, which is still far from certain, it would indicate an entirely separate aspect of the internal opposition that had been building against Sadat's government, before and after the crackdown on the Moslem fundamentalists heretofore regarded as the most serious danger to his regime.

Egyptian authorities have been investigating Shazli's organization since last spring, and the prosecutor general charged in June that it had received $3 million from Libyan leader Muammar Qaddafi via Syria and that all the Arab members of the anti-Sadat Steadfastness and Confrontation Front were backing it.

The front, consisting of South Yemen, Algeria and the Palestine Liberation Organization in addition to Syria and Libya, was formed following Sadat's trip to Jerusalem in November 1977. Its main objective has been to work for the overthrow of the Sadat government and block the Egyptian-Israeli peace process from going any farther.

Shazli's group consists of dissident Cabinet ministers and journalists who are predominantly leftists as well as some communists, according to the Egyptian prosecutor general, Abdul Kader Ahmed Ali.

Among the many mysteries of today's assassination of Sadat is how the assailants managed to infiltrate the Army artillery unit in the midst of what were obviously stringent security precautions taken for the military parade.

Even official spectators with credentials were being searched for arms with a metal detector as they entered the parade grounds and there was a swarm of security men and security officials all over. When Sadat arrived, dressed in a bemedalled blue military uniform with a green sash over his shoulder, he was flanked by three security men standing on running boards on either side of the car plus two holding on in back.

Police lined the motorcade route from his official residence in Eiza to Nasr City on the outskirts of Cairo where a large stadium and parade ground are located, both built by his precesessor, the late Gamal Abdel Nasser. While security was tight among spectators, it was apparently insufficient among the participants, enabling the conspirators to gather in one truck.

Furthermore, the truck, one of three travelling abreast down the parade road, was on the inside lane closest to the reviewing box. This raised the question of possible complicity among some of the officers involved in organizing the parade or at least the one artillery unit to which the assailants belonged, although Egyptian embassies abroad were stressing that the killing had been an isolated incident with no suggestions of a coup attempt.

Sadat is the first Egyptian leader to be assassinated since the Free Officers group took power from King Farouk. The last attempt came in 1954 when a known Moslem fundmamentalist fired eight shots at close range at Nasser while he was visiting the Mediterranean coastal city of Alexandria. Miraculously, Nasser escaped injury.