It was not long ago that things seemed to be going Iraq's way. Oil provided the wealth with which a new future could be created. An agricultural base made possible a more diversified economy than is the case in most of the other oil states. Dreams of nuclear power would give Iraq, so it was believed, the preeminence it has always sought in Arab politics.

Moreover, Egypt -- Iraq's nemesis in Arab politics -- had in a dramatic way broken with the Arab system. If Egypt had given up on pan-Arabism it was now time for Iraq's place in the sun. All along, a whole political generation in Iraq had believed that the Eqyptians were usurpers of the pan-Arab idea, that Egypt was really "pharaonic," that it was to Iraq more than to anyone else in the Arab world that the pan-Arab mantle belongs. Anwar Sadat's course seemed to confirm the Iraqi reading of the world.

Of the wounds inflicted on the other Arabs by military defeats, of the limits that the poorer among them have come to face, Iraq seemed to be relatively free. Iraq could be, so its young and ruthless leader Saddam Hussein insisted, whatever she set her mind on being. And in doing so Iraq and her leader would of course prevail in that vast Arab world that presumably yearned for leadership and redemption. An Arab summit held in Baghdad in 1978 gave Saddam Hussein the forum he needed to bring Iraq into the mainstream of Arab politics. Another great occasion, the meeting of nonaligned states scheduled in Baghdad for September 1982, was to be Iraq's opportunity to be a leading Third World state.

Many outsiders who are forever anxious to adopt a new claimant for power agreed with all this. Iraq, we were told, was the newest "regional power" -- we never quite give up on the idea of regional powers; when some collapse we merely anoint others. All the themes and labels that were once affixed onto the shah's Iran were suddenly Iraq's. It was there that a bright new world was in the making.

Now all this is in ruins. The nuclear dream -- disconnected from a scientific base below -- was thwarted by Israel in its raid on Baghdad in June 1981. The great victory over the Iranian revolution that was to quarantine that revolution and make it come to terms with the world has turned into a large disaster. In one of the heady moments of the war, the Iranian province of Khuzistan was renamed Arabistan. And now, in a reversal of fortunes, Iraq must fall back onto the very principle of territorial integrity that she had violated.

The once vibrant economy that allowed Saddam Hussein to finance his war and insulate his society from the burden of the war is at a standstill. Indeed, for some time now the war has had to be financed by the other Arab states of the Gulf -- the same states that Saddam Hussein sought to "save" from the fire of the Iranian revolution and, then, if victorious, cast Iraq's shadow over. More frustrating still, the "compromised" Egyptian state once disdained by Iraq is now invited into the Gulf by Iraq herself as some kind of would-be savior.

Iraq's dreams of power have proved to be short-lived. The weaknesses that states hide from their frightened citizens, from dazzled outsiders, eventually assert themselves.

The verdict on the battlefield gives the day to the Ayatollah Khomeini. The "great conjurer" has supplied material and martial evidence of his power. In rebellion he vanquished the shah who had strutted on the world stage with so much arrogance and pretension. While in power, he has vanquished Saddam Hussein. This gives Iran a reprieve. But the verdict on the battlefield in no way deals with Iran's essential problems at home; and, like all military victories, this one too can backfire as the victor pushes his claims too far and tries to make permanent and tangible military verdicts.

A year or so after it had come to power, the Iranian revolution had stalled at home. It found in revolutionary subversion and then, in the war with Iraq, an escape from its own incoherence at home, from the collapse of the secularist-theocratic alliance that had toppled the shah, from its incapacity to draw up a social contract acceptable to those who fought for something other than the replacement of one dictatorship with another.

The attempt to lead the "dispossessed" (in the ayatollah's words) in a campaign of fury against the political order in the neighboring Arab and Moslem countries is unconvincing. In Iraq's overreaching there is perhaps a lesson for Iran as well: Victories on alien territories are elusive. In an era as messy as this one, states have a difficult time keeping their own domains intact, let along imposing their will and exporting their doctrines to others.

A few but not many in the countries neighboring Iran will throw caution to the wind and join the ayatollah's crusade, for so many of the politically conscious in the Moslem world are no longer convinced that Iran's way holds out much hope for them.

As for trying to embody and lead the Shia resentment against the larger world of Islam, this too is doomed. Wherever large numbers and majorities of Shia Moslems are to be found, as they are in Iraq, Lebanon and Bahrain, they must in the nature of things work within their own states. In an intensely nationalistic world, collaboration with a foreign power, even disguised in the garb of Islamic solidarity, carries the risk of political death. To survive, political phenomena must issue from native soil. Much as Khomeini may insist on the relevance of his message to the whole Moslem world, nationalism and reasons of state determine the way nations behave in the realm of Islam as they do elsewhere.

From the moment he prevailed against the shah, Khomeini has insisted that Iran was his base, but that his real domain was the realm of Islam as a whole. Underneath the sermons of pan-Islam lurked Iranian ambitions -- all the more so in the universe of the younger mullahs and the activists of the Islamic Republican Party. Now that there is little left of the message of millenarian redemption that the Iranian revolution started with, pan- Islam has given way to an aggressive "Iranian man's burden." The ideology has become a cover for Iranian reason of state.

In the phase we have just entered, the Islamic incantations of Khomeini will be less persuasive than they were when he rose to assert the unity of Moslems against the West and to preach the politics of authenticity and virtue. And should the Iranians try to set up some kind of puppet regime in a defeated Iraq (something akin to Vietnam's sordid game in Cambodia), the ideological and religious mask would fall and we would see more clearly than ever before that here as elsewhere, all kinds of ideas serve as but a cover for the ambitions of men and nations.

The man who took Iraq into this fight did it more or less on his own. Indeed, he gave the war his own name. Its official Iraq designation, Qadisiyyat-Saddam, evoked the memory of Qadisiyya, the 7th century battle in which Moslem armies prevailed against the Persian Empire, and bestowed it on Saddam Hussein's own person.

During that brief period in which the war went his way, he was sure that his world owed him gratitude and obedience, that he had found an answer to the weaknesses and troubles of the larger Arab world beyond. Were he to prevail, it would have been his victory. Defeat, however, as we know, is an orphan. True to Saddam Hussein's sense of things, the defeat will be Arabized: It will be not just his own or his army's, but the Arab world's as a whole.

Such a claim should be resisted by the other Arab states. A distinction ought to be made between sympathy for the Iraqi people, respect for Iraq's territorial integrity and a stand against Iran's delusions of power on the one hand, and Saddam Hussein's own political fortunes on the other. After all, this was his war and his choice. He aimed andian rode too high and now the moment of reckoning has arrived.

Saddam Hussein knows the rules of the political game through which he rose to the top. If he survives there, it will be more a tribute to his society's will to forgive, or to the lack of a political process that leaves intact men and institutions beyond the ruler's person, than to the skill and compassion with which he led his country through the stormy times that the "panacea and plague" of the Iranian revolution forced on her.

As for Khomeini's and the Iranian clergy's attempt to export "revolutionary happiness," they ought to be reminded that all good crusades and charities must begin at home. The hell unleashed by the revolution eventually has to make peace with the world. Nations cannot indefinitely live on frenzy; men cannot indefinitely be kept in a trance.