Iran's revolutionary leadership, never well disposed to the foreign media, seems close to declaring total war on them. It has announced its intention to close down the British news agency Reuter, which, along with Agence France-Presse, is the only major Western news agency still operating out of Tehran.

The decision is a yardstick of the regime's deep insecurity in the wake of the terrorist campaign that has taken such a devastating toll in the past two weeks. Few revolutions have had such a deep suspicion of the outside world as Ayatollah Ruhollah Khomeini's. Yet while affecting an outward indifference to world opinion, one senses that inwardly it craves the world's respect.

Failing, in their own judgment, to have secured it, the authorities have responded by refusing access to the overwhelming majority of journalists who apply for it. The process by which the regime admits the chosen few, and then permits them to remain, is a mysterious one. Merely to acquire or renew a press card one has to present oneself at five or so different government departments in different parts of the city.

With the convulsions of recent weeks, Iran is moving toward a reign of terror in which a paranoid regime is less and less concerned with its reputation in the outside world, as it is molded by the few correspondents who are admitted, and more and more concerned with the impact they make on the domestic Iranian arena.

I happened to be one of the chosen few. My impression was that when, two weeks ago, the authorities granted me a 10-day entry visa, they had decided that, although during my previous visit I had written things that they did not like, that consideration was outweighed by what I had also written about President Saddam Hussein of Iraq, their opponent in an almost year-long war. The Islamic republic was to hold a conference to condemn the crimes of Saddam Hussein and apparently it was thought that I, and one other European correspondent, should be encouraged to attend it.

For during that previous visit, I found myself approvingly quoted by Islamic Republic, newspaper of the ruling Islamic Republican Party and the state radio. True, my reports, as purveyed to the Iranian public, often bore little resemblance to what I had actually written. Thus, after the release of the American hostages, the Tehran Times quoted the "famous" British journalist David Hirst asking the rhetorical question: "What chance can there be for the Mini-Satan (Saddam Hussein) if the Great Satan himself [the United States] has suffered such a crushing defeat?"

All this, however, is a logic that can work both ways, as I discovered early on Sunday morning when an agitated colleague knocked on the door of my hotel room bearing a copy of the latest Islamic Republic. A front-page headline announced: "David Hirst, the famous British spy, arrives in Tehran." The accompanying report explained that "if there are any two journalists in the world who are dangerous to the Islamic Republic [of Iran], David Hirst is the first of them."

The newspaper went on to describe my articles as "false and provocative. . . Islamic Republic once more brings to the attention of the Islamic Guidance Ministry the presence of this famous spy, especially as, according to reports we have received, his presence here has caused astonishment even in Western circles."

Clearly the real target was less myself than the Guidance Ministry, and I was merely the plaything in some new twist in a running power struggle. The Guidance Ministry quickly produced a defense saying that I had been admitted "upon agreement of the War Publicity Headquarters," but was due to "my untrue coverage of Iranian affairs" it had already been decided to expel me. That the ministry called me a "reporter" and not a spy, amounted, in current Iranian terms, to a defense of my professional credentials.

The fact is, however, that the Guidance Ministry had not even read my articles. But when I asked them what my position now was they said that, for my own security, I should leave the country as soon as possible and that, until I did so, I had better leave the Intercontinental Hotel in case "ignorant people" decided on their own initiative to bring the "spy" to account. By "ignorant people" they meant komitehs and other such neighborhood vigilantes.

Nothing of the sort happened, however, and I discovered in the following two days just how few ordinary journalists actually read Islamic Republic or pay any attention to the fantastic accusations that have long been its stock in trade. The name David Hirst appeared to mean nothing in the banks or airline offices. It was only when I went to the police for my exit formalities that the officer in charge smiled a smile of complicity as if to say, "Ah, the great spy, we have been expecting you."

It is no secret that the police -- like much of the bureaucracy inherited from the government of the late shah -- detest the parallel, revolutionary bureaucracy to which they are obliged to defer. It is a rule of thumb that, for insecure Middle East regimes, foreign radio stations, whose voice reaches every citizen, head any blacklist, followed by news agencies, and then the leading Western newspapers.

The BBC is now a veritable obsession of the revolutionary leadership, because so many people listen to its Persian-language broadcasts, which reproduce reports of British newspaper correspondents. It was the BBC's coverage of the funeral of the 72 people killed by a terrorist bomb last week that appears to have particularly infuriated the authorities by suggesting that the crowds were rather less than the 5 million they claimed, and less distraught than they should have been.

There are still more signs of spontaneous friendliness in Iran than officially inspired xenophobia. But even those who go out of their way to befriend foreign "spies" in their midst can raise a moral dilemma to which there is probably no answer.

"You are sending our young men to their death," said one, in reference to the almost daily executions of opponents of the regime. And, insofar as we do contribute to the paranoia of a regime whose reflex is increasingly the firing squad and the mob, he is probably right.