The Iranian parliament formally set conditions for release of the American hostages yesterday and said that, depending on the U.S. government's response, the hostages could either be released all at once, let go in groups over a period of time or held for trial and punishment in Iran.

The parliament's decision to seek a negotiated end to the year-long confrontation with the United States came shortly before 4 a.m. EST after a 4 1/2-hour debate in which opposition from Islamic hard-liners suddenly seemed to collapse.

The parliament, or Majlis, authorized the Iranian government to convey the terms to the Carter administration officially in a move that appeared to herald the freedom of the 52 Americans and an end to Iran's long and costly isolation.

Former foreign minister Sadegh Ghotbzadeh, who has been involved in efforts to settle the hostage issue, said late last night that "if everything goes well," a first group of hostages could be freed as early as this week. Now that the parliament has announced its conditions, Ghotbzadeh said in a telephone interview, "the rest will go easily."

Informed of President Carter's televised statement, Ghotbzadeh said, "I think he is right in making this statement. It's right except that it [the parliament's decision] is more than a positive step. I think it's a really essential and fundamental step taken. The main obstacle has been set aside."

Ghotbzadeh said that Khomeini "doesn't interfere" in the hostage issue now and that the hard-liners in parliament are no longer in a position to block the hostages' release.

Asked if any arrangements with the United States have already been worked out, Ghotbzadeh said, "No discussion, no negotiation, no deal has been made."

Ghotbzadeh said that Iranian officials, notably Prime Minister Mohammed Ali Rajai, where scheduled to meet Algerian and Swiss diplomats in Tehran today to arrange for transmission of a complete text of the conditions to the American government. An intermediary in the hostage issue said another topic would be the possible flight of a first group of hostages out of the country.

According to another intermediary, the implementation of Iran's conditions is currently being negotiated between Washington and Tehran via phone calls to Paris, Washington Post correspondent Ronald Koven reported from the French capital.

The intermediary there said that paid-up helicopter parts for Iran are waiting to be shipped in Italy, presumably from Augusta Bell, which produces helicopters under license from Bell Helicopter of Texas. However, it was not immediately clear whether this delivery would have been arranged by Washington as part of a deal for the hostages' release, or would merely follow the ending of the Western trade embargo against Iran as the result of such an agreement.

The Majlis essentially adopted four conditions announced last month by Ayatollah Ruhollah Khomeini after embroidering them with clauses that add new details to Iran's demands but no major additional hurdles to meeting them.

The militant Moslem students holding the hostages said they had no immediate comment on the Majlis vote but would meet with Khomeini today to receive his instructions and then issue a statement, the Reuter news agency reported from Tehran. Saturday, the militants called for a massive demonstration in front of the embassy and invited the public to attend an unspecified "ceremony" inside the occupied compound.

The parliament's vote came suddenly after intense debate on the terms, which were formally presented to the assembly by a special seven-number parliamentary commission and broadcast to the Iranian people in live radio coverage of the public session. After the debate came the bogged down in fairly niggling objections to certain provisions, the house speakers, Hojatoleslam Ali Akbar Hashemi Rafsanjani, abruptly called for a stand-up vote on the four conditions, and a clear majority of the legislators approved the terms.

According to an unofficial U.S. translation of the broadcast, the head of the commission, Hojatoleslam Moussavi Khoini, listed the four conditions and added:

"The Islamic Republic government will release all 52 U.S. criminals [hostages] in return for the fulfillment of these conditions by the U.S. government. However, should some of these conditions require more time, then when all conditions are accepted by the U.S. government, with the fulfillment of each condition a number of criminals will be released with the approval of the Islamic government."

Khoini, reading from his report, also said, "Should the U.S. government fail to comply with all or some of the conditions, then the judicial system, in accordance with its required duty, will carry out its duty and punish the criminals." He said that the Iranian government would prepare the approved conditions in Persian and English and send them to the U.S. government for implementation. "Should any differences between the two texts emerge, the Persian version is valid," the report said.

While the parliament set no deadlines for U.S. acceptance of the conditions, Rafsanjani warned against delay by the Carter administration.

In what he called a "message to the American government," Rafsanjani said: "This decision made by the Majlis does not mean that the hostages have been handed over to you. We have showed the world that we are ready to forgive them in return for obtaining our rights. However, from now on should any delay occur and should there by any delay in the release of the hostages, then the world must know . . . that it is no longer our fault, that it is the fault of the U.S. government."

Before voting on the terms, the Majlis rejected several proposals for new conditions or amendments to the ones recommended by the special commission. Among the proposals was a demand that four AWACS radar planes sent to Saudia Arabia after the outbreak of the Persian Gulf war be withdrawn and a requirement for three hours of a U.S. television time to present Iran's case to the American people. This was backed by 19 legislators but immediately dismissed by the parliament.

Deputies speaking in favor of adopting the commission's terms argued that such a move had nothing to do with either the U.S. presidential election or the war with Iraq. They said the process of deciding conditions was initiated in September before the war broke out and insisted that the Iranian timetable was an independent one.

According to an unofficial translation by Iran's state-run Pars news agency, the Majlis adopted the following basic points as the Iranian government's conditions for the release of the hostages: an end to "all direct or indirect political and military interference in the affairs of the Islamic Republic of Iran;" the unfreezing of "all Iranian assets in and outside of the United States;" the cancellation of "economic and financial actions and measures" against Iran, and the return of the late shah's property, with U.S. recognition of "the right of the Iranian government to the deceased shah's wealth and that of his close relatives."

The conditions also stipulated that the Iranian assets be put at the government's disposal so that it may use them "in every possible way," and that financial relations between the United States and Iran revert to those existing before President Carter's Nov. 14, 1979, order freezing Iranian assets.

This aroused considerable debate on the floor of the Majlis, as several deputies expressed fears that it meant a return to economic "dependence" on the United States. However, this condition was not amended despite the complaints that the language should be clarified.

Also allowed to stand was a point in the third condition saying that in the event of U.S. court claims against Iran in connection with the revolution, the U.S. Embassy seizure and the arrest of Americans in Iran, the U.S. government should answer for any verdicts against Iran. Some deputies argued that this did not specifically preclude strictly commerical claims against Iran by U.S. companies still owed money for services in Iran and that such claims should be ruled out.

In other specific objections, deputies said that the conditions should call for the involvement of the U.S. Congress in the agreement. Most of the opponents, however, focused on the timing of the parliament's decision, saying conditions should not be approved before the U.S. presidential election and while the Iranian-Iraqi war is still going on.

According to informed sources quoted by Reuter in Tehran, several extra conditions -- including calls for the withdrawal of U.s. nAvy vessels from the Persian Gulf area and an apology for past U.S. support of the shah -- were dropped as unobtainable during secret parliament debates last Sunday, Monday and Wednesday.

In a reaction to the parliament's vote, U.N. Secretary General Kurt Waldheim said yesterday that he was "gratified by progress which appears to have been made." Waldheim also offered U.N. assistance in arranging the actual release of the hostages.