The last two American reporters working in Iran fled Tehran early today to avoid probable arrest and imprisonment at the hands of Islamic revolutionary committees that have taken the law into their own hands.

After spending our last night in Tehran hiding in a friend's apartment, Doyle McManus of the Los Angeles Times and I joined three British television reporters on an early-morning flight to Rome. All of us had been arrested at least once in the last two weeks and accused of working against Ayatollah Ruhollah Khomeini's Islamic revolution.

Already isolated politically because it refuses to release 52 American hostages held since November, Iran is rapidly closing itself off from Western news coverage as well. Only a handful of Western journalists remain and they operate under severe restrictions.

We left Tehran after officials in President Abol Hassan Bani-Sadr's government openly admitted that the government could not protect us in the face of direct threats from the revolutionary committees challenging Bani-Sadr's authority. These officials strongly advised us to leave the country.

Last August and again in January during peaks in the hostage crisis and Iran's continuing internal power struggle, all American correspondents were expelled from the country. Over the past three months, the government had selectively allowed a few publications to send reporters into Iran, and then squeezed most of them out by refusing to extend visas.

Today's departure was much more ominous. McManus and I perceived dangerous warning signs in remarkable similar attacks against us, by name and hotel room number, that were published this week in three Iranian newspapers implying we were spies.

In a visit to the Foreign Ministry, which two days earlier had offered to renew our visas, we received all the confirmation we needed to decide that it would be foolhardy to do anything but get the next flight out.

Mahmoud Hashemi, the Foreign Ministry official who deals with the foreign press, said in a troubled voice:

"The ministry cannot guarantee your safety. We cannot control the revolutionary committees," which now arrest people at will in the streets of Tehran. "We only learn about arrests of foreign journalists after they've done it."

When we again brought up the visa applications, another official put the matter more bluntly.

"Why are you doing this?" the ashen-faced aide asked. "I strongly recommend that you go."

An American free-lance reporter, Cynthia Dwyer of Buffalo, N.Y., was arrested in May and the government has not been able to provide any information on her status.

Bani-Sadr issued an order only last month giving full responsibility for entry and expulsion of the foreign press to the Foreign Ministry with the cooperation of the Ministry of National Guidance. Islamic mob power seems to have overruled such authority now.

The three television staffers who left had gotten an even blunter warning: They were among eight foreign and Iranian jouralists arrested by a revolutionary committee on Monday. The three were released after 20 hours of detention and a thorough search of their rooms.

The two other foreign journalists arrested Monday are still being held in Evin Prison, the site of most executions for political crimes. Carl Sorenson of Danish television and Hami Sami, who works for Turkish television, face possible charges of espionage for allegedly working secretly for CBS-TV.

The three Iranians who were arrested because of their work with foreign TV crews face an even more uncertain fate.

Not having a foreign diplomatic representation to seek their whereabouts from the government, they have not been traced so far. The revolutionary committee believed responsible for theirarrests has said nothing about them, although residents at the Intercontinental Hotel watched them being taken into captivity.

A concerted attack on Iranians working for foreign journalists could seriously affect the efforts of remaining Western correspondents, since few foreign journalists speak Persian and therefore most rely on interpreters and other Iranian staff.

A four-man staff at Reuter News Agency provides the fullest foreign coverage now available. Three London papers usually have correspondents in Tehran and there is also a smattering of other European publications present. t

The three released television newsmen, Scott Chisholm of Visnews and John Connor and Simon Maxwell of UPITN said their captors openly scoffed at the supposed authority of much-harassed Foreign Minister Sadegh Ghotbzadeh and Minister of National Guidance Nasser Minachi. The interrogator told the captives that the committee did not recognize the authority of the ministers despite Bani-Sadr's order.

Major Tehran newspaers recently joined the strident campaign to portray American journalists as enemies by running front page pictures of the Intercontinental Hotel with headlines saying it was a "nest of spies," the same term that is used for the American Embassy taken over by militants last Nov. 4.

An article yesterday in Ettelaat, an afternoon newspaper, was full of references to CIA and the influence of multinational corporations.

Ettelaat said the hotel "has a complex telegraphic system used by the foreign journalists and spies."

It added, "There is no control whatsoever in the comings and goings and meetings of the foreign reporters. Their bags also are not even inspected for arms and drugs.

"One can dare to claim that these foreigners disguised as reporters entering Iran are CIA agents who get in touch with antirevolutionaries in Iran. This is the place of the spies of the West."

Islamic Republic, the organ of the majority party in parliament, said under the headline, "Two American Spies in Iran," that it had discovered the presence of the two American newspaper reporters in the country following the committee arrests.

The paper failed to mention that it had reported my presence here, approved by the foreign minister, two weeks ago when it quoted from a story about the presence of at least one American hostage in the central city of Isfahan.

Such details appear insignificant for a newspaper intent on using such information against Ghotbzadeh, who is seen in Washington as being a key to any possibe resolution of the hostage crisis.

Ghotbzadeh, a longtime close ally of the country's religous and political leader, Ayatollah Ruhollah Khomeini, has said he will not be foreign minister in a government Bani-Sadr is expected to present shortly to parliament for approval.

Azadegan, Tehran's other morning newspaper, portrayed our hotel as a den of iniquity that showed nightly "sexy filmsby videotape." The journalists there must be American, the paper said, because only they could afford bills such as about $22 for lunch.

The closed-circuit films were cut out by the hotel yesterday. The hotel has already been censoring western movies itself on the system. Any romantic scene would be blotted out, often by a still of an oil well, although the sound remained.

These stories attacking the Intercontinental fanned Tehran's normally turbulent rumor mill and we picked up reports that the hotel would be attacked today after the traditional Friday prayers. No such attack occurred, but the rumors caused a panic at the city's Western-oriented hotels. oJournalists moving out of the Intercontinental found no hotel wanted to associate with foreign reporters.

We checked out at midnight and went to the Hilton which discovered we were journalists, and refused us rooms. The hotel has had about a 10 percent occupancy rate since the revolution overthrew the shah in January 1979.

From the Hilton we went to a friend's apartment and began counting the hours until it was time to go to the airport for the dawn flight.

Getting out of Tehran through the capital's Mehrabad Airport requires hardy determination under any circumstances. Thousands of middle class and wealthy Iranians are flying out daily, many on vacations to avoid Tehran's summer heat, others with hopes of starting life anew.