President Reagan announced an embargo yesterday on all U.S. imports from Iran and a ban on 14 kinds of "militarily useful" items previously exported to Iran.

Reagan said he was taking the action as a result of Iran's "unprovoked attacks" on U.S. military forces and merchant vessels in the Persian Gulf, its "continued aggression" against nonbelligerent nations there, its sponsorship of terrorism and its refusal to accept U.N. Resolution 598 calling for a cease-fire in the Iran-Iraq war.

"We are taking these economic measures only after repeated but unsuccessful attempts to reduce tensions with Iran and in response to the continued and increasingly bellicose behavior of the Iranian government," Reagan said in a statement.

"These measures will remain in place so long as Iran persists in its aggressive disregard for the most fundamental norms of international conduct," it added.

Reagan said the United States "accepts the Iranian revolution" and hopes to have normal relations with Iran once Iranian belligerence and tensions in the gulf diminish. These views have been conveyed to Tehran through diplomatic channels, he said.

"Unfortunately, the Iranian government's response to date, in deeds as well as in words, has been entirely unconstructive," he added.

The ban on Iranian imports is to take effect as soon as possible and on the export of 14 additional categories of U.S. goods within 10 days, the statement said.

The House and Senate have voted overwhelmingly in favor of a ban on imports from Iran, particularly oil. White House officials said Reagan wanted to take the action by executive order to allow himself more freedom to lift the ban later if relations between the United States and Iran improve.

The main U.S. purchase from Iran has been crude oil, which accounted in 1986 for $500 million of the total $600 million worth of Iranian exports to the United States. Iran's earnings from oil exports to this country increased significantly in the first seven months of this year, reaching $1 billion.

Other Iranian exports are pistachio nuts, caviar and textile products.

The U.S. cutoff on the 14 categories of "militarily useful" items that Iran has been purchasing here will affect mobile communication equipment, tractors, boats, diesel engines, electrical generators, hydrofoil vessels and inboard and outboard motors.