Iranian leaders, once united in the purpose of their war with Iraq, are now divided on what must be achieved to end the nearly five-year-old conflict.

When Iraq invaded Iran in September 1980, Iran quickly focused on ousting Iraqi President Saddam Hussein and his ruling Baath Party -- just as Iraq sought to remove the Iranian government of Ayatollah Ruhollah Khomeini.

Fifty-six months and more than 500,000 casualties later, however, there is a clear split among Iranian leaders over how best to end the war while still serving their interests: by insisting on withdrawal of Saddam Hussein from power, by asking for the collective resignation of the Baathist party, or by simply ceasing hostilities and leaving the question to the Iraqi people.

Several peace-seeking delegations, including missions from the Islamic Conference Organization, the Palestine Liberation Organization, the United Nations and others have traveled to Tehran to try to soften Iran's attitude, but all have been disappointed.

According to reliable diplomatic sources in Washington, Iran's parliament speaker, Hojatoleslam Ali Akbar Hashemi Rafsanjani, is expected to lead a political and economic delegation to Japan early next month. The agenda for the trip has not been announced, but observers believe peace negotiations and the fate of the incomplete multibillion-dollar petrochemical project of Bandar Khomeini are among the topics to be discussed.

Japan, which has extensive trade with both Iran and Iraq, has attempted several times to bridge the wide differences between the warring countries.

The question of Iran's demands came up again during U.N. Secretary General Javier Perez de Cuellar's fact-finding trip to Iran and Iraq in April.

In his meetings with four top Iranian leaders, Perez de Cuellar received contradictory signals about what their real demands were. Some, including President Ali Khamenei and Prime Minister Mir Hossein Mousavi, seemed to be among those who demand nothing less than the resignation of Saddam Hussein and the withdrawal of his party from power.

According to Iranian newspapers that carried accounts of Perez de Cuellar's meetings with Iranian officials, Iran's conditions for ending the war were not brought up in detail in the secretary general's meeting with Khamenei.

However, the Iranian president made it clear that "from our experience, we know that as long as Saddam Hussein and the Iraqi Baathist regime are in power, our just demands will not be met and materialized.

"We have realized that as long as Saddam is in power, the war will continue. Their regime is an unreasonable and illogical one that does not understand our legitimate rights," he said.

The secretary general, however, had more luck with Rafsanjani, who is also Khomeini's representative in the Supreme Defense Council, and Foreign Minister Ali Akbar Velayati, who reportedly advocate ending the war even without Saddam Hussein's ouster.

Perez de Cuellar was received warmly by Rafsanjani, who kept complaints about the United Nations' failure to condemn Iraqi aggression to a minimum and encouraged him to continue his efforts.

"The first positive attitude in the world in recent times has come from you, the secretary general of the United Nations. If there is one way to stop the war, it is the way you have started," Rafsanjani said, according to the official newspaper Kayhan.

It was at that meeting that Rafsanjani sent a signal that the Iranian leaders who want to see the war ended, even without Saddam Hussein's ouster, are a minority and face problems in convincing the others.

"We believe that if we give up the question of punishment and condemnation of the aggressor, we have backed off from the principle of our revolution," he said, according to Kayhan.

Iran long has threatened to launch its final assault, but observers say that many leaders favoring peace have realized that with their Air Force just barely functioning and the strength of their ground forces becoming more questionable, their interest might be served best by ending the war.

Perhaps the most important factor in reaching any settlement is the final word of Khomeini, who is said to be trying to stay away from the internal split on this matter.

Observers who follow events in Iran point out that Khomeini's words are to be considered more from a religious angle rather than a political one.

As one observer put it, "the question now is which one of these factions will have a better luck pulling Khomeini to their side."

His speeches in recent months, although basically reiterations of what he has said before, have been interpreted differently by observers inside and outside the country.

Khomeini said in March, "Victory or defeat loses any meaning, because serving God and obeying His orders is all victory . . . . Even if we are defeated or not defeated . . . it makes no difference."

Secretary of State George P. Shultz said in an interview with the Boston Globe that Khomeini's speech might indicate "that Iranians can say that they have done their duty because they have made a major effort."

Others, however, take note of different speeches in which Khomeini has repeated that the Iraqi regime and its president must be toppled or the war will continue.

"You all know what Saddam will do to us and to our country if he gets a chance. This is not a war between Iran and Iraq. This is a war that Saddam started to destroy Iran and Islam, and we will fight against him to the end and until he is defeated," Khomeini said a few days before Perez de Cuellar visited Tehran.