Four U.S. Navy destroyers yesterday shelled and set ablaze an oil platform used for Iranian military operations in the central Persian Gulf in what the administration called "a measured and appropriate response" to last week's Silkworm missile attack on a U.S.-flagged tanker in Kuwaiti waters.

The warships pounded the Iranian military platform 120 miles east of Bahrain with 1,000 rounds of heavy gunfire at 2 p.m. (7 a.m. EDT) yesterday after giving the Iranians at the facility a 20-minute warning to flee. The Navy later dispatched explosives teams to blow up a section of the installation that survived the shelling, Pentagon officials said.

Defense Secretary Caspar W. Weinberger said that the former oil-drilling platform at Rashadat housed radar and communications equipment used to track convoys of U.S.-escorted tankers and that Iranians used the facility to "launch small boat attacks against nonbelligerent shipping."

"It is a prudent yet restrained response to this unlawful use of force against the United States and to numerous violations of the rights of other nonbelligerents," President Reagan said in a written statement.

Shortly after the warships shelled the first installation, a team of Navy commandos destroyed Iranian radar and communications equipment on another platform about six miles north. The attack, prompted when U.S. forces spotted Iranians fleeing the facility, was described by a Defense Department spokesman as an unexpected "target of opportunity" and had not been planned.

Iran's U.N. ambassador, Said Rajaie Khorassani, condemned the attack, saying the United States "has opened an all-out war against my country." But several Arab states and numerous Western allies, including British Prime Minister Margaret Thatcher, applauded the strike.

Pentagon officials said no Americans were injured in the attacks and search-and-rescue efforts have found no Iranians in the waters nearby. Officials said they believe the 20 to 30 Iranians on the first platform escaped before the firing started. The Iranians made no attempt to fire back, officials said.

Weinberger said the United States plans to take no further action in response to the Iranian Silkworm missile attack on the U.S.-flagged Kuwaiti ship Sea Isle City last Friday.

"The action is complete," Weinberger said. He added, "We do not seek any further confrontation with Iran but we will be fully prepared to meet any escalation of military actions by Iran with stronger counter-measures."

U.S. military officials said they believe the Iranians fired a Silkworm missile from a mobile launcher on the Faw Peninsula at the north end of the gulf that hit the Sea Isle City in Kuwaiti waters on Friday. But intelligence sources later reported no Silkworm launch sites at Faw, making a military strike on the area pointless. Defense sources said they believe the Silkworm launchers were moved after the attack.

"What is important is for Iran to realize that they cannot make unprovoked attacks on neutral, nonbelligerent legitimate shipping in the gulf without some cost to them," Weinberger told reporters at a Pentagon briefing yesterday.

The decision to attack the Iranian military platform came after hours of internal debate and high-level meetings Friday and Saturday over the type of target, according to administration officials. Officials said care was taken to select a site in international waters and to protect against casualties. The action also was planned to avoid expanding the U.S. military commitment to include the direct defense of any gulf nation.

When Reagan decided late Saturday that the Iranian military platform would be the target, U.S. military officials ordered three destroyers -- the USS Leftwich, USS Young and USS Hoel -- to steam from the Gulf of Oman through the Strait of Hormuz into the Persian Gulf. Only one of the 12 U.S. warships already in the gulf, the destroyer USS Kidd, had large enough guns to bombard the platform.

The four destroyers rendezvoused in the central gulf with the smaller frigate USS Thach about 9 a.m. gulf time yesterday. The five ships then moved northwest toward the Rashadat platform and maneuvered into a pre-attack position about 3 1/2 miles from the target at 1:30 p.m. gulf time, Pentagon officials said.

The target was a hulking installation that had been bombed by Iraqi warplanes last November, rendering it useless for oil drilling. Pentagon officials said the platform, in two sections standing high above gulf waters, had since been converted into a fortified outpost with antiaircraft weapons guarding radar and communications equipment. Pentagon sources said it was virtually defenseless against attack from large warships.

A U.S. helicopter pilot patrolling in the area Oct. 8 reported seeing tracer rounds fired from the platform. Pentagon officials said the pilot did not return fire because he was not certain the shots had been directed toward his craft.

During the action yesterday, the guided missile cruiser USS Standley moved northeast of the platform to protect U.S. forces from air attacks. In addition, two F14 fighters and an E2C Hawkeye surveillance plane, dispatched from the USS Ranger in the North Arabian Sea, provided air cover for the ships.

At 1:40 p.m., the Thach radioed its first warning to the men on the platform, using Farsi and English over military air distress and international distress frequencies.

"Rashadat, Rashadat, this is the U.S. Navy," declared the warning. "We will commence firing on your position at 1400 hours (2 p.m.). You have 20 minutes to evacuate the platform."

Iranians on the platform began climbing onto a supply barge that had been tied to the structure and 10 minutes later it pulled away.

At 2 p.m. (7 a.m. EDT), the four destroyers began pounding the platform with five-inch gunfire. The guns spewed armor-piercing and high-explosive munitions as well as rounds that burst into fragments when they neared the target. Two minutes later, flames engulfed the structure, including a 201-foot oil derrick.

The four destroyers, steaming in single file, made four firing runs on the platform using both manned and automatic guns that can fire up to 20 rounds a minute. The attack lasted 85 minutes, and the ships fired about 1,000 shells.

Weinberger said that an Iranian F4 fighter took off from a military airfield during the shelling, but "quickly vanished," returning to Iran, and that no attempts to interfere with the attack were made.

While fire consumed the structure's north section and its derrick, the shorter southern section had not been destroyed.

"They decided to finish that off" using dynamite planted by a Navy demolition team that went by small boat to the smoldering platform, according to Pentagon spokesman Fred S. Hoffman. When the team had finished, "all that remained was three pilings sticking up out of the water," he said.

During the attack on the first platform, military personnel noticed "boats were taking people off another platform" about six miles north, Hoffman said.

"After the {distant} platform was abandoned, U.S. Navy personnel went aboard, looked around, destroyed radar and communications equipment, then left," Hoffman said. Pentagon sources said a Navy SEAL (sea, air, land) special operations team carried out the mission.

He said this incident had not been planned with the earlier attack and called the platform a "target of opportunity."

Secretary of State George P. Shultz, speaking to reporters aboard his plane from Cairo to London yesterday, said some advance notice was provided to friendly countries, especially those in the gulf. He said the Soviet Union and all other members of the U.N. Security Council had been informed before the attack was made public.

Weinberger held his news conference about 15 minutes after the final rounds were fired.

Staff writer Don Oberdorfer contributed to this report.