Anti-Khomeini commandos in a rented tug stormed and captured a swift Iranian Navy missile boat off Spain Thursday as three of the heavily armed craft, manned by Iranian sailors, were heading to Iran from the French port where they had been built, Spanish authorities said yesterday.

The seizure was the most spectacular move so far against the Islamic revolutionary government of Ayatollah Ruhollah Khomeini by rightist exiles, some of whom remain sympathetic to the deposed Iranian monarchy now represented in Cairo by the 20-year-old son of the late shah Mohammad Reza Pahlavi.

A spokesman for Azadegan, or "Free People," said the Paris-based group claimed responsibility for the takeover. He said the 30-knot, 147-foot guided-missile patrol boat, the Tabarzin, was captured at midday Thursday "without a shot" and will be used as a "fighting unit" in a struggle that he said will be waged against the fundamentalist system set up by Khomeini and his clerical followers in Iran.

The main immediate value of the seizure seemed to be publicity for the anti-Khomeini exiles, however, and their spokesmen in Paris and Washington swiftly called news organizations with a "communique" about the operation -- claiming at first that all three of the boats had been captured and were now flying the former shah's lion-and-sun imperial flag.

Most antigovernment agitation, both inside and outside Iran, has been conducted by dissidents to the left of the Islamic clergy running Iran. The recent bombing of the ruling Islamic Republican Party headquarters in Tehran, for example, is generally attributed to the Mujaheddin-e-Khalq, a leftist but strongly Islamic guerrilla group that generally supports exiled former president Abol Hassan Bani-Sadr.

Iran officially referred to the missile boat incident for the first time late yesterday. In an interview with Iranian state radio, monitored by Reuter, Iranian armed forces joint chief of staff General Valiollah Fallahi mainly cited foreign news reports about the incident but said Iran had started diplomatic moves to ensure that the boat gets to Iran, its original destination.

The Azadegan spokesman, Behrouz Kia, declined in a telephone interview to say where the seized craft was taken or what the commandos plan to do next with it. Spanish authorities told Reuter the patrol boat was anchored off Tangier last night and the commandos were negotiating to enter the harbor. Moroccan officials, however, said it was not in Moroccan waters.

The other two patrol boats, the Khanjar and Neyzer, were proceeding east into the Mediterranean under a Spanish Navy escort, apparently continuing their journey to Iran, Spanish authorities told news agencies.

All three were turned over to about 30 Iranian sailors on Aug. 1 at the French port of Cherbourg, according to French authorities. Each boat was armed with a 70 mm cannon and a 40 mm antiaircraft gun. Their Ottomat missiles were to have been added later.

The boats were the final batch of a group of 12 ordered in 1974 under the shah's government, French officials told Agence France-Presse. The first nine were delivered by 1978. But delivery of the final three was held up by the French government for more than two years because of financial problems with the revolutionary government in Tehran and the seizure of American hostages, AFP reported.

President Francois Mitterrand ordered their release in what was seen as a gesture to appease the Iranian government of President Mohammed Ali Rajai, upset because France granted asylum July 29 to the fugitive Bani-Sadr.

According to Spanish authorities, the three boats spent Aug. 2-5 in the northern Spanish port of El Ferrol taking on supplies and then, with Spanish permission, pulled into Cadiz on Aug. 7 for refueling.

In Cadiz, the Iranian commandos, posing as tourists, rented the tugboat Salazon for what they told Capt. Antonio Jajara was to be a pleasure outing. According to The Associated Press, the approximately 15 commandos took along wine and food to make their ruse more believable.

But once at sea near the gunboats, they pulled guns, smashed the tug's radio equipment to prevent Jajara from alerting Spanish naval authorities and forced him to pull alongside the last of the three boats churning single-file along the Spanish coast, Jajara told Spanish reporters.

There was no attempt to fight off the unarmed tug, despite the cannons aboard the patrol boats, and no attempt to flee, despite the missile craft's superior speed, Jajara was reported to say. This led to speculation -- reinforced by claims from Azadegan in Paris -- that at least some of the Iranian crew were cooperating with the commandos.

Kia, of Azadegan, reported some resistance to the takeover but said it was quickly overcome. He said some of the Iranian sailors -- "the Islamics," he called them -- were "under arrest" and would be allowed to return to Iran unharmed. Others, he said, would remain outside Iran, perhaps joining the dissident exile group.

Azadegan is headed by Gen. Bahram Aryana, 74, a former chief-of-staff who is based in Paris but who has support among exiles, chiefly former officers, in several European cities.

The takeover of the boat recalled Israeli seizure of five gunboats from the Cherbourg yard on Christmas Eve in 1969. France had embargoed the Israeli-ordered boats, but there was speculation at the time that French intelligence operatives had helped the Israeli crews in the maneuver.

It was considered possible that French-Iranian relations, already strained, would come under new stress because of the action of the Paris-based exiles even though the boats seemed clearly to have left French control.