Amid extraordinary security precautions, the coffin of president Mohammed Anwar Sadat was carried today on a horse-drawn caisson in a military funeral procession to the spot of his assassination four days ago and buried in a temporary crypt under Egypt's Tomb of the Unknown Soldier.

Even before his flag-draped coffin was buried, the three former U.S. presidents -- Richard Nixon, Gerald Ford and Jimmy Carter -- who came to pay their last respects to an old ally in peace were whisked away from the funeral and taken directly to the airport.

Carter and Ford left for the United States but Nixon, who has strongly supported sale of U.S. radar planes to Saudi Arabia, immediately flew to Jeddah for meetings with the kingdom's royal family, in what the State Department described as a "private visit."[Details on Page A32.]

The ceremony took place before the empty stands of the parade ground in the northeast suburb of Nasr City, where Sadat died in a hail of bullets on Tuesday when a group of Moslem insurgents broke from a military parade and opened fire on him.

For security reasons, the Egyptian public was kept far from the burial scene, with only the presidents, kings and other dignitaries invited to the funeral allowed in, together with more than a thousand journalists and large contingents of police and troops.

At one point, a crowd of several thousand mourners tried to break through the outer cordon of police ringing the grounds, and police had to fire a few shots into the air to disperse them.

But other than this show of grief and a small crowd at the entrance to the grounds waving pictures of Sadat and wailing, there was surprisingly little public demonstration of sorrow for a leader generally thought in the West to have been a highly popular figure at home.

To those who had witnessed the spectacular slaying of Sadat only four days ago, it was macabre watching his body being drawn along the same parade ground to the very spot of the attack and then interred in the Tomb of the Unknown Soldier.

The disjointed funeral procession got under way early in the morning with a prayer service held nine miles away from the burial site at a mosque inside the military hospital grounds in the southern suburb of Maadi, where Sadat was pronounced dead.

Then his coffin was flown by helicopter to a point near the parade ground and loaded onto a caisson drawn by six black stallions.

From there, the procession, consisting of contingents from the various branches of the armed forces, top officers, high Egyptian officials and foreign guests, marched behind the caisson, 900 yards down the parade tarmac to the main reviewing stand, where Sadat had been shot. There the Sadat family, with President-designate Hosni Mubarak, were standing to receive condolences.

Following this and the departure of all non-Moslem dignitaries, the Sadat family and a few selected close friends, including the son of the late shah of Iran, Reza Pahlavi, and Sudanese President Jaafar Nimeri and his wife, walked the final 200 yards to the open pyramid-shaped monument to the unknown soldier.

Sadat's underground crypt lies in the center, marked by a square black stone on which his epitaph has been etched.

It begins with a Koranic verse: "Do not consider those killed for the sake of Allah dead but alive and blessed by the side of the Almighty."

Below the verse and the date of his death is written: "Hero of war and peace. He lived for the sake of peace and was martyred for the sake of principles."

His widow, Jehan Sadat, their daughters Nohaa, Lebna and Jehan and their son Gamal, gathered around the opening of the crypt, with Pahlavi, Mubarak and other government officials, to watch as 13 pallbearers, members of Sadat's personal bodyguard, lowered the coffin down the 12 steps into the interior. This was accompanied by a 21-gun salute by nearby cannon.

Dressed all in black and wearing tinted glasses but without a scarf over her head, Sadat's widow stood bravely with her head held high and only occasionally lifted a hand to wipe a tear with a white handkerchief.

Gamal, the only one of the family to descend into the crypt before it was sealed with 10 slabs of limestone, struck the same almost defiant pose as his mother.

The presence of Pahlavi, whose own father died in exile here only 15 months ago, added a poignant touch to the ceremony. He was reported to have been in France at the time of Sadat's assassination and to have flown back for the funeral.

Sadat's remains will be housed in the crypt only until a new mausoleum and mosque are completed for him a few hundred yards away.

Several incidents at today's ceremony showed how jittery Egyptian security and visiting dignitaries were.

The first was when Egyptian security men for unknown reasons abruptly put up barriers cutting off most of the foreign dignitaries from the Egyptian officials walking in the cortege as the procession neared the reviewing stand.

The group cut off included former secretary of state Henry Kissinger and former president Richard Nixon, who were walking just ahead of former presidents Jimmy Carter and Gerald Ford, with Israeli Prime Minister Menachem Begin in the middle.

After hurried consultations between U.S. and Egyptian security personnel, the group was let through to the reviewing stand where Jehan Sadat was receiving visitors.

While this was taking place, a second incident occurred. About a half mile from the stand, police fired a single shot and then a burst of three or four when several thousand Egyptian mourners tried to break through to approach the ceremony.

Scores of white-uniformed policemen could be seen running toward the mourners to block their advance onto the parade ground.

A short time later, the rush of U.S. security men to get limousines bearing the three former presidents away from the ceremony created an instant of concern that another problem was occurring.

After their departure, Begin followed, surrounded by a crowd of 50 Egyptian and Israeli security men, and by foot he returned to his lodging a half mile away. Begin, in strict observance of Jewish law that forbids riding in a motor vehicle on the Sabbath, had requested accommodations within walking distance of the ceremony.

Apparently to make sure no new attempts might be made on the lives of Egyptian leaders or foreign dignitaries, a 14-man presidential guard detachment chosen to fire three volleys after Sadat's crypt was sealed were stripped of their normal weapons and given bolt-action, pre-World War II Enfield rifles with blanks. Reporters watched as the guards were taught how to shoot them, only a few minutes before the funeral cortege arrived.

Despite these jittery moments at the funeral, Cairo as well as the rest of the country was reported calm today after a bloody insurrection Thursday in Asyut, 250 miles south of here, where Moslem insurgents attempted to take over the central security headquarters. Local sources reported 45 persons killed in the 24-hour clash.

Libyan radio said Agence France-Presse, the French news agency, had reported there was also trouble in Minya, a town about 60 miles north of Asyut. But the AFP bureau here denied putting out the report and it appeared Libya was simply waging psychological warfare against the shaken Egyptian government.

Earlier, Libyan radio said there were revolutionary committees preparing to stage an uprising following Sadat's assassination, but other than in Asyut, there has been no sign of any spread of Moslem extremist activity.

Nonetheless, the danger clearly remains and is likely to be a major preoccupation of Mubarak after he is sworn in Wednesday as Sadat's successor.

Mubarak, the ruling party's nominee and the only candidate to succeed Sadat, is expected to be overwhelmingly approved in a referendum Tuesday.

The burial today of Sadat in such strange and sad circumstances culminated what may be the most extraordinary five days in the contemporary history of Egypt. Never in modern times had an Egyptian head of state been assassinated and the insurrection in Asyut stands as the worst case of organized domestic armed violence.

The government has warned that it intends to take "severe measures" to prevent the recurrence of similar incidents, but this in itself is not likely to assure that more will not take place.

Mubarak, a former Air Force general, repeatedly has told visiting dignitaries that he is convinced there is no general unrest or even other small pockets of Islamic extremists within the armed forces, and that he has their solid support as well that of the government.

So far there is no visible evidence to contradict his assertion, but after Sadat's violent death no one here is altogether confident there are no other Islamic groups at work inside the armed forces, such as the one that assassinated Sadat, of which the security is unaware.

Mubarak's first task, however, is to form a new government. The old one will hand in its resignation Wednesday as soon as Mubarak is sworn in and he will then begin the task of choosing his own men.