MANAMA, BAHRAIN, OCT. 10 -- Iran demanded today that the United States repatriate immediately four sailors "taken hostage" in last week's attack by U.S. helicopters on Iranian patrol boats in the Persian Gulf.

Iran's official news agency IRNA said the Iranian Foreign Ministry summoned Swiss Ambassador Heinrich Reiman, who handles U.S. interests in Tehran, and gave him a note protesting Thursday's "provocative" and "war-mongering" clash, in which an Iranian patrol boat was sunk. The United States is holding four Iranian sailors and the bodies of two seamen who died of their wounds.

Iraqi jets today attacked a tanker in the gulf and bombed Iranian onshore oil installations, while residents in Baghdad reported that a large explosion rocked several areas of the Iraqi capital after what was presumed to be a long-range Iranian missile struck the city early this morning.

An official statement carried by the Iraqi News Agency blamed a "technical malfunction at a TNT and ammunition depot."

{Early Sunday, IRNA reported that Iran fired a surface-to-surface missile into Baghdad. It said the missile struck al-Rashid garrison, which it described as an important military center, at 12:30 a.m. local time.}

The Iranian news agency said that 50 workers were "martyred" or wounded during Iraqi air raids today in and near the city of Ahvaz, 300 miles southwest of Tehran. Iraq acknowledged that its Air Force bombed the area.

An Iraqi military communique said Iraqi jets dealt an "effective and precise blow" to a "large naval target" -- or tanker -- near the Iranian coastline. Shipping sources said the 32,000-ton, Liberian-registered oil tanker Mykonos was hit by an Iraqi missile, suspected of being a French-made Exocet, off the Iranian coast.

Also today, IRNA quoted the commander of the Revolutionary Guard Corps, Mohsen Rezaei, as saying Iran had obtained and copied U.S.-made Stinger antiaircraft missiles a long time ago.

The report gave no other details. It followed by a day an announcement in Washington by Secretary of Defense Caspar W. Weinberger that Iranian gunboats in the gulf have been equipped with Stingers.

News services reported the following:

Two associates of Mehdi Hashemi, an extremist linked to Ayatollah Ruhollah Khomeini's designated successor, were shot by a firing squad, according to a broadcast today by Tehran radio.

The radio, monitored in Nicosia, Cyprus, said Reza Moradi and Fathollah Mohammed Kazemzade were shot at dawn Wednesday in Tehran's Evin prison.

Hashemi, 46, was executed at the prison Sept. 28 for plotting against the government.

The executions are considered part of a power struggle between Parliament Speaker Ali Akbar Hashemi Rafsanjani and Ayatollah Hossein Ali Montazeri, Khomeini's designated successor and Hashemi's former mentor.

Iraq, meanwhile, told the Organization of Petroleum Exporting Countries today that it wanted an oil production quota equal to Iran's.

The Iraqi News Agency said First Deputy Prime Minister Taha Yassin Ramadan told OPEC's quota committee that Iraq and Iran must have equal quotas.

Iraq has refused to comply with a quota of 1.54 million barrels per day set by OPEC in June for the second half of 1987. It demanded parity with Iran, which was allocated 2.369 million barrels per day.

Oil industry sources estimate that Iraq produced 2.4 million barrels per day in September.