The United States ended its naval exercises in the Mediterranean off Libya yesterday, apparently closing the chapter on a brief, violent military clash in the Gulf of Sidra that President Reagan lauded as a demonstration of an American "ability to defend the free world's interests."

In his first public comments on the conflict in which a U.S. Navy task force destroyed at least two Libyan ships and an antiaircraft radar site, Reagan said in New Orleans that "we are aware of intensive Libyan preparations" for terrorist actions against Americans. However, the United States "will not be intimidated by new threats of terrorism against us," he added.

Libyan leader Muammar Qaddafi had threatened to send suicide squads to attack Americans if U.S. forces engaged Libyan forces by crossing his "line of death" across the mouth of the Gulf of Sidra, which Qaddafi claims as Libyan territory. Administration officials also said they had received intelligence reports before U.S. ships crossed that line on Monday that Qaddafi was sending terrorists to attack U.S. diplomats in Europe.

Defense Secretary Caspar W. Weinberger told reporters yesterday that "I can't see" how the U.S. naval operations and combat in the Gulf of Sidra "would encourage Qaddafi to do anything. Whether it deterred him or not requires the resident psychiatrist to come in and help us."

Security around Reagan, who was in New Orleans for a political fund-raiser before flying to California for Easter, appeared to be exceptionally tight. Extra guards also were visible at the Pentagon in the offices of top Navy officials and in the open courtyard of the building. Security also has been tightened at National and Dulles airports, police said.

Defense Department sources said there were feverish efforts in Libya yesterday to repair the damaged SA5 antiaircraft missile site at the coastal town of Surt. U.S. intelligence, sources said, detected a Soviet Candid transport flying radar parts from the partially completed SA5 site at Benghazi to Surt. The launchers, which had futilely fired at least a half-dozen SA5s at U.S. planes earlier this week, have been reloaded with new missiles, officials said.

If the Libyans had managed to get the Surt complex back in operation and had turned on the fire-control radars indicating that the missiles were ready for launching, the Navy planned to bomb the entire complex and not just the radars as was the case Monday, officials said. On that day A7 bombers fired four HARM (High-speed Anti-Radiation) missiles at the radars, according to the Pentagon.

A senior U.S. official also said yesterday that U.S. naval forces in the gulf had eavesdropped on radio conversations by Syrian pilots assigned to Libyan air force planes, as they repeatedly refused to leave the ground while U.S. Navy jets were in the area.

Had Libyan forces killed Americans during the recent Navy exercise -- code-named "Prairie Fire" -- the plan called for bombing Libyan naval and air bases, if the president approved, according to informed sources. If Libya had launched a massive attack on U.S. forces, officials added, Prairie Fire called for bombing key industrial targets.

The three aircraft carriers that had been steaming north of Libya -- USS America, USS Coral Sea and USS Saratoga -- yesterday left the area north of the Gulf of Sidra. The Navy plans to keep the America in the Mediterranean while sending the Saratoga home to Mayport, Fla., next month and the Coral Sea home to Norfolk, perhaps in May.

A second carrier is likely to join the America in the Mediterranean later this year. The Saratoga has been at sea since Aug. 25, in apparent violation of the Navy's recent pledge to keep carriers out no more than six months.

Reagan, Weinberger and Adm. William J. Crowe Jr., chairman of the Joint Chiefs of Staff, yesterday praised Vice Adm. Frank B. Kelso II, commander of the 6th Fleet, and his men for their performance over the past week. Reagan telephoned his congratulations to Kelso on the task force flagship, the USS Coronado.

The president told the men of the 6th Fleet: "Your determination and tireless response to Libyan threats makes this world a safer place . . . .You have sent a message to the whole world that the United States has the will and, through you, the ability to defend the free world's interests."

Weinberger said the fleet's actions were "both restrained and appropriate." Crowe called the exercise "a flawless operation."

Qaddafi has notified shipping agents that his navy intends to conduct target practice in the Mediterranean 100 miles north of Sidra, according to maritime executives. Pentagon officials said yesterday that they had not yet seen any sign of a firepower demonstration.