MANAMA, Bahrain (AP) _ Iraq said its warplanes attacked a ship off Iran's coast Monday, and Iran reported its gunboats intercepted and searched 10 ships in the Persian Gulf and then allowed them to go.

In a delayed report, gulf-based marine salvage executives said Iranians in five motorized dinghies fired at a Spanish oil tanker Thursday in the southern gulf but inflicted little damage.

An Iranian war communique said that on Sunday, Iranian gunboats intercepted 10 cargo ships and oil tankers near the Strait of Hormuz at the southern tip of the gulf but they were released after searches showed they were not carrying any Iraqi-bound goods. It did not identify the ships.

Iran and Iraq have been engaged in a border war since September 1980, and that expanded to the ''tanker war'' in 1984 with attacks on shipping in the gulf.

The latest Iraqi air strike was reported by the Iraqi New Agency in a dispatch monitored in Cyprus. It quoted a military spokesman as saying Iraqi jets attacked a ''a large maritime target'' - indicating it was an oil tanker - at 9 p.m. and scored an effective hit.

Shipping executives said they could not confirm the Iraqi report.

In their account of the attack on the Spanish tanker Santa Maria, they said the Iranians in rubber dinghies fired at the ship while it was four miles off the United Arab Emirates port of Mina Saqr in the southeastern gulf.

The ship was hit by rocked-propelled grenades that punched two small holes in the hull, according to the shipping officials.

They said the Santa Maria left the gulf and then anchored for a day at the Arabian Sea port of Fujairah for minor repairs.

It was the first Spanish vessel to be caught in the tanker war in which some 270 commercial vessels have been struck since early 1984, according to the shipping executives.

They said they believed it was in retaliation for a July 1 Iraqi attack on the Iranian tanker Dena.