Egypt's President Anwar Sadat ordered a ceasefire in the border war with Libya tonight, but only after a day of heavy bombing of military installations inside Libya.

The official Middle East News Agency reported that Sada acted after a meeting with Algerian President Houari Boumediene, who flew to Egypt today after conferring in Tripoli with Libyan leader Col. Muammar Qaddafi, and with Yasser Arafat, leader of the Palestine Liberation Organization. Arafat has spent the past three days seeking unsuccessfully to halt the fighting.

If the Egyptian accounts of the day's events are correct, it appears that Sadat first sent his air force to destroy any Libyan installations that posed a threat to Egypt and then called a halt to the bombing.

An official Egyptian communique said Egyptian bombers struck Kufra airfield, in southeastern Libya, because Libya had sent planes there that might endanger Egypt if "the Libyan regime used the base in committing one of its follies."

The communique acknowledged that "our forcestook the initiative in attacking the airport," and said that the runways and some buildings had been destroyed.

Earlier, the Egyptians said they had virtually destroyed the Libyan air base at Adem, near Tobruk. In that action, two of the Egypt's Soviet-built Sukhoi bombers were shot down by the Libyans, the first losses acknowledged by Egypt since the outbreak of bombing and shelling along the border four days ago.

Egypt also said it had destroyed two radar instrallations in eastern Libya. In all, the Egyptian operations clearly represent this country's greatest military effort since the 1973 war with Israel, and their scale indicates that a substantial portion of Egypt's combat-ready aircraft and crews have been diverted to the western front.

Sadat said in a speech Friday that the Libyans had provoked the initial Eygptian raides and that his forces had taught Qaddafi "a lesson he will not forget." But he also said then that the Egyptians would strike again if they felt it necessary.

A major unanswered question is how the Soviet Union will react to the weekend's fighting. The Soviets, who built the modern Egyptian army and are the source of most of its equipment are now closely linked ot Libya and have sold Qaddafi vast quantities of sophisticated arms. There have been reliable reports that both Soviet and Cuban advisers are with the Libyan armed forces.

Moscow Radio has warned of "evil consequences" from the fighting, saying it could only help Israel, but he Soviets are not known to have intervened with either Libya or Egypt in th current flare-up.

The Egyptian cease-fire announcement did not say whether Boumediene had brought Sadat any specific message or request from Qaddafi, or whether the Libyans had asked for the cease-fire. It reported only that Sadat had ordered an "immediate cessation of all military activities at the border."

There has been no independent verification from any source of what has really been happening in the reported air raids and artillery duels between the two feuding North African Arab neighbors.

Most of the action has occurred in remote desert areas accessible only by air. Foreigners have been banned from entering the border zone.

Still to be determined is the future of the economic, political and social relations between the two countries. Qaddafi claims to have hundreds of millions of Libya's oil dollars on deposit in Egyptian banks, and their withdrawal could be a crippling blow to this country's economy. Qaddafi however, needs the estimated 200,000 Egyptians who work in Libya, operating schools airports and hotels.

The two countries maintain diplomatic relations and are still theoretically linked, along with Syria, in a federation of Arab republics.

News agencies also reported these development:

Libya said nothing about a ceasefire. United Press International reported.

The Tripoli-based Arab Revolutionary News Agency said the Egyptian air force lost 14 planes - six Sukhoi-20 fighters, four Mirage jets, two Mig-21 jets, and two long-range Tupolev bombers. The Tupolevs were shot down by ground forces, the agency said.

The agency added: "Naturally we feel sorrow and regret for the losses sustained by the Egyptian air force. . . because this also represents a loss for the whole Arab nation - the loss of a striking force that should have been used to smash the Zionist enemy."

In Alexandria, meanwhile, senior diplomats said they thought both Egyptian and Libyan official reports of the scale of the fighting were exaggerated, Reuter reporter.

The fighting did not keep Ali Shames, the Libyan charge d'affaires, from attending a reception at the Egyptian embassy in Beirut, Agence France-Presse reported. The reception marked the 25th anniversary of the overthrow of the Egyptian monarchy. AFP said the Libyan's arrival astonished his Egyptian hosts.

In Cairo. AFP added, the black-white-red flag of the Federation of Arab Republics, linking Egypt, Syria and Libya, flew as usual outside the Libyan legation.