President Reagan yesterday ordered a ban on sale of American-made scuba gear to Iran, declaring that the underwater swimming equipment would be used in attacks on Persian Gulf oil rigs and shipping.

"Available information indicates that this type of equipment will be directed to military use by Iran and used in attacks on oil rigs and possibly shipping or in support of other terrorist or other military action," the president said in ordering the export controls.

He added that the export controls will "be instrumental in remedying the direct threat posed by the use of this equipment against United States interests in the region and in our efforts to persuade other potential sources of similar equipment to likewise prohibit its transfer to Iran."

The president's action came after a "large shipment" of scuba gear, bought in the United States by Iran several months ago, was held up by another country, not identified by the government.

"These exports pose a direct threat to United States flag ships and naval vessels as well as ships of other nations in the Persian Gulf and to oil facilities of friendly nations," said acting commerce secretary Bruce Smart. The Commerce Department supervises export controls.

Iran has been using small speedboats to lay mines in the Persian Gulf. And the presidential order indicates a concern over a possible new Iranian tactic: using divers to place underwater explosives on oil rigs or ships in the region.

The United States has banned the sale of military equipment to Iran, including planes, helicopters and outboard motors as well as chemicals that can be used in gas warfare and crowd control. In addition, U.S. diplomats in 1985 pressed Japan to stop selling outboard motors to Iran so they could not be used against Iraq in marshy areas where the neighboring countries were fighting.

Last year, Iran bought $83,000 worth of scuba gear from U.S. makers.

The presidental order also prohibits other countries from reselling U.S.-made scuba gear to Iran.