The U.N. commission to help solve the U.S. Iranian crisis admitted defeat today and left Iran after Ayatollah Ruhollah Kohomeini personally dealt its mission a fatal blow by refusing to allow it to visit all the American hostages unconditionally.

In a short statement before the five-man commission took off for Zurich, a spokesman said the panel was "not in a position to prepare its report." But the statement avoided specifying that Iran's refusal to allow the commission to see the hostages was the cause of the breakdown.

The carefully worded statement said the commission would confer with U.N. Secretary General Kurt Waldheim in New York "with a view toward pursuing its task, which it regards as indivisible."

The commission's U.N. executive jet took off at 8:10 a.m. Tehran time, barely five hours after Iran failed in a final effort to persuade the United Nations to change the commission's mandate. The panel, which had been in Iran for 17 days without seeing the hostages, turned down Iranian officials' entreaties to extend its stay during three hours of talks after midnight.

Foreign Minister Sadegh Ghotbzadeh told reporters after the negotiating session that he was "a bit disappointed" by the commission's decision to leave. But he claimed the departure was "neither a victory nor a defeat for anyone" and said he hoped the commission "would return here soon" to continue its work.

The failure of the commission leaves the hostages still in the custody of their militant student captors with little hope of being freed, or transferred to government custody, until well into April, if then. Two weeks ago Khomeini said the hostage issue would have to be decided by a parliament that is to be elected this month but is not expected to be ready for serious business until sometime in April.

The commission's failure was sealed at an hour-long morning meeting of the divided Revolutionary Council at Khomeini's north Tehran residence yesterday. Khomeini then swung his authority behind the miltant captors who have held an estimated 50 Americans hostage for the past 128 days.

In a communique implicitly repudiating efforts by President Abol Hassan Bani-Sadr and especially Ghotbzadeh to allow the commission to visit all the hostages, Khomeini reiterated the militants' most extreme demands, as formulated 11 days ago.

As broadcast by Tehran Radio news, Khomeini said that:

The students should "make available to the commission" copies of seized U.S. Embassy documents to help them investigate "crimes of the U.S. and the traitor shah," Mohammad Reza Pahalvi, now living in exile in Panama.

The commission could meet the unspecified number of hostages considered guilty of crimes committed by the United States and the shah and "interrogate them."

But the commission could see all the hostages only if it first "expressed its views about the crimes of the deposed shah and interference of the aggressive United States."

Under the original "package deal" agreed to by Iran, the United Nations and the United States, the commission was to have seen all the hostages as part of its visit, before issuing its report.

Ignoring the blows he thus dealt the prestige of his hand-picked governing body, which had set a deadline for the students to permit the visit or transfer control of the hostages, Khomeini declared "my support for the Revolutionary Council and the person of the president once again, and I ask all to assist them and not spare support for them."

Despite the humiliation, Bani-Sadr and Ghotbzadeh separately spent hours at their offices yesterday afternoon and evening with the commission trying to put Khomeini's announcement in the best possible light and presenting new and vauge promises in efforts to keep the mission alive.

Ghotbzadeh and Revolutionary Council spokesman Hassan Habibi arrived at the commission's Hilton Hotel quarters shortly before midnight in what appeared to be yet another effort to dissuade the U.N. commission from leaving.

During three hours of conversations, a succession of telephone calls between Tehran and the United States indicated that a compromise effort of some sort was being discussed.

But at least two commission members -- Andreas Aguilar of Venezuela and Louis Pettiti of France -- were known to be sufficiently unimpressed from the start to demand privately that their colleagues join them in formally ending the mission.

Only Mohammed Bedjaoui of Algeria was reported to favor the Iranian thesis that Khomeini's statement did not preclude the commission's continuance in Tehran, with Adib Daoudi of Syria and Harry Jayewardence of Sri Lanka said to be sitting on the fence.

Also favoring their departure was a rash of recent newspaper attacks accusing the commission of being manipulated by the United States and, in one case, of being "accompanied by many CIA diplomats."

Sources close to the commission made no secret of their fears of being sucked into the parliamentary election campaign now under way.

In any case, Khomeini's communique left the commission little leeway, according to diplomats.

Analysts noted that the United States, in agreeing to the commission, had specifically ruled out any visit that included interrogation of the hostages, which Khomeini now favors.

Moreover, the demand that the commission first judge the presumed guilt of an unspecified number of alleged "spies" was described by specialists as juridically unacceptable.

The commission from the start refused to accept any purloined embassy documents as evidence for fear of appearing to exceed its humanitarian belief in visiting the hostages and becoming involved in grand jury style-operations smacking of an anti-U.S. show trail.

After the commission had left the Hilton Hotel for Mehrabab airport this morning, three of the militants from the embassy turned up in the lobby with three large cartons, vaguely resembling pizza boxes, crammed with documents that they said they wanted the commission to have.

U.N. officials told the militants they were unable to accept the documents in that form.

The commission briefly seemed close to success Thursday when the militants -- citing intense pressure by the Iranian government -- offered to hand over the hostages to the Revolutionary council rather than allow the commission to see all the Americans.

The militants apparently had never thought the Revolutionary Council would accept responsibility for the Americans because that would bring the council under international pressure to free the hostages outright.

But after the offer was accepted, the captors fought back, rallying support from both extreme right-wing clerical forces and extreme lefists. They staged demonstrations in front of the embassy to rally support. Although the crowds were far smaller than those in the early days of the crisis, when hundreds of thousands of Iranians turned out to back the embassy occupation, they apparently were sufficient to discourage any government attempt to take custody of the hostages.

Khomeini first tipped his hand Saturday after the captors had promised to hand the hostages over to Ghotbzadeh. Khomeini's office said he previously had remained "silent" on the transfer issue.

Isolated in the Revolutionary Council, which grudgingly had approved his transfer plan, Ghotbzadeh insisted that the council's orders be respected. h

But in the end the issue was put to Khomeini, who apparently preferred to keep his revolutionary credentials intact rather than back up his foreign minister and president. As he has in the past, Khomeini humiliated his closest lieutenants, to whom he had entrusted day-to-day government operations. c

At the embassy, the militants and a large crowd outside the main gate cheered and broke into revolutionary songs praising Khomeini when his announcement was read over the radio and rebroadcast on loudspeakers on the embassy walls.

Only days ago Bani-Sadr said in an interview, "The students have nothing to decide. They have only to obey." However, events have made it clear that they will not obey his government, but Khomeini.

What effect this setback will have on Bani-Sadr's hopes of winning a clear-cut majority in the new parliament remains to be seen.

But the timing of the hostages' eventual liberation is not likely to be advanced if the Islamic Republican Party emerges as the most important force in the new parliament.

The party's clerical right-wingers, bouyed as a result of the commission's failure, now have taken their revenge for Bani-Sandr's landslide presidential victory in January by frustrating his proclaimed desire to solve the hostage problem and press ahead with his vision of a radical grass-roots revolution.