A war that seemed it would never end may suddenly be over. Iran's startling announcement this week that it would immediately accept a United Nations cease-fire has breathed new hope for peace into the war-torn region.

The U.N. cease-fire plan, known as Resolution 598, was adopted a year ago and had been agreed to by Iraq. But Iran had stubbornly refused to consider a halt in the fighting.Ever since a possible truce was debated in recent years, Iran always insisted that Iraq's leader, Saddam Hussein, be removed from office as a precondition to any cease-fire. The most encouraging thing about Iran's agreement this week is the fact that it was done unconditionally. There was no reference to Hussein and no other stipulations, such as the removal of U.S. warships from the Gulf.

U.N. General Secretary Javier Perez de Cuellar said it would take a week or 20 days to work out the truce details. The tragedy is that it has taken eight years; one million casualties - two-thirds of them Iranian; two ruined economies; an ebb and flow of advance and retreat that has left both countries where they started, behind their own borders along the 740-mile front. What a savage exercise in futility.

The reasons for Iran's suddenly giving up the fight were not spelled out, although Iran's military chief, Ali Akbar Hashemi Rafsanjani, said the downing of a civilian airliner by a U.S. warship was a consideration. He said Iran did not want to see other such "bitter incidents" occur. He also condemned the "ruthlessness" of Iraq in using chemical weapons.

The real reasons were probably less altruistic: (1) Iran's economy is in shambles; (2) the country is diplomatically isolated and having a hard time buying badly needed weapons; (3) losses in manpower and equipment have been heavy; (4) Iran has lost significant battles in recent weeks and has been pushed onto the defensive; (5) morale in both the military and among civilians is low and was badly shaken by missile attacks on cities; (6) recruiting new soldiers has gotten difficult, and most important, (7) the hard-line Iranians, epitomized by the Ayatollah Khomeini, have lost a power struggle with more pragmatic leaders, such as Rafsanjani.

The aged Khomeini is dying of cancer and reportedly is no longer able to exercise control. Iran's strategy after a cease-fire apparently will be to broaden diplomatic ties with the West. Whether that will include the U.S. is not clear, but there are possibilities.

It is clear that sending U.S. warships to the Persian Gulf was not a mistake and may have done much to bring about peace.

Iraq is responding rather cooly to Iran's acceptance of a cease-fire. The chief fear of the Iraquis is that Iran will use the halt in fighting to repair and strengthen its armed forces - and fight again in the future.

That is a concern, but it seems unlikely. The lessons of the past eight years have been too harsh. It's hard top believe the people of Iran would support a renewal of deadly combat.

If a real truce takes hold in the Gulf, it means that tankers no longer will be attacked by either side and U.S. warships - and those of other nations - can be withdrawn. That would help to lower the chance of accidents, like the downing of the airliner with 290 aboard.

The most reassuring development would be a firmly established peace instead of just a cease-fire. That may take some doing, but the chances are there. In the meantime, the world is thankful that the guns are falling silent in the Persian Gulf.