Prime Minister Shahpour Bakhtiar's hopes of reaching a political compromise with Ayatollah Ruhollah Khomeini collapsed today amid street violence that led to Iran's worst bloodshed in weeks.

According to conservative casualty estimates, at least 35 persons were killed and hundreds wounded when troops opened fire near Tehran University on students taunting them and throwing molotov cocktails. In the ensuing shooting, which went on for more than three hours, troops on rooftops and in the streets fired at the demonstrators in a main square and through adjacent streets.

Opposition sources here close to Khomeini said the attempts at a compromise finally fell through in the early afternoon and that Bakhtiar's planned departure Monday to see the ayatollah in France was "out of the question for the time being." An aide to the prime minister acknowledged that the trip "will have to be postponed."

In France, Khomeini rejected the meeting proposal and instead called on Bakhtiar to resign, emphasizing that he considers Bakhtiar's government illegal because it was appointed by Shah Mohammad Reza Pahlavi.

Bakhtiar told a news conference early Monday that Khomeini's demand that he resign was "unacceptable" and said he would not leave for Paris immediately, news services reported. However, he said, "Doors will stay open."

[Bakhtiar said he would stay on as prime minister despite the renewed violence.]

The opposition sources, who had been instrumental in trying to put the compromise together, expressed doubts that Bakhtiar could survive in office. If Bakhtiar does resign, even many key Khomeini aides are frightened at the specter of civil war between the armed forces and the ayatollah's increasingly militant followers, who are now demanding arms.

Diplomatic sources reported that the death blow to the compromise proposal was delivered by bloodshed in the provinces yesterday and today's fresh violence around Tehran University.

Even before the violence at the university erupted, Bakhtiar's hopes of flying to Paris seemed compromised by a Khomeini elamieh , or message, telephoned from his exile near Paris to Tehran's religious leaders at 5 a.m.

Mimeographed and distributed in Tehran streets by midmorning, the message reiterated Khomeini's standard demand that the prime minister resign before being received, condemned his "illegal" government and said suggestions that he would receive Bakhtiar as prime minister were "an absolute lie" and a "conspiracy."

The ayatollah's entreaty to the nation to "maintain its stand" in the overheated atmosphere -- in the face of the government's get-tough reinforcement of martial law last Thursday -- made the fresh violence seem practically inevitable.

Nonetheless, opposition sources involved in the negotiations with Bakhtiar insisted that the final details of the Paris trip were still being negotiated right through lunchtime.

Central to the deal, the sources said, was Bakhtiar's willingness to resign once he actually met Khomeini, who, in turn would appoint him caretaker prime minister to run a provisional government for two or three months to prepare for the ayatollah's Islamic republic.

Even had the deal been struck in Paris, some Khomeini aides said more talks would have been required with military commanders before they accepted the return of the ayatollah, whom many officers consider an irreconcilable foe.

If the armed forces balk, Khomeini sources said they were prepared to force the issue. Judging from the rapid disintegration of military discipline, an internal uprising could well carry Khomeini's revolution to victory, although at the price of splitting the last functioning organ of state authority.

Reporters covering the university area violence, for example, ran into one deserter being given civilian clothes and saw a soldier shoot and wound his commanding officer before being shot dead by other troops.

Indicative of the rising tide of violence was an assassination attempt this morning against Gholam Hossein Danishi, the only Moslem cleric in the lower house of parliament. He was shot and wounded in the chest by unknown assailants.

Danishi publicly endorsed Bakhtiar during the vote of confidence debate recently, an act of courage not likely to have escaped the notice of Khomeini backers who claim the parliament and government both are "illegal."

Outside the Intercontinental Hotel, crowds chased a car, forced it over to the curb and set it ablaze after accusing its driver of being a secret police agent. The driver escaped.

The trouble at the university started when a crowd of thousands defied orders to disperse and troops opened fire. Demonstrators threw themselves to the street to avoid injury. But when the first four minutes of solid firing ended, several persons were lying in pools of blood.

The demonstrators, students for the most part, seemed even more determined than Friday, when they also taunted troops into opening fire. Witnesses said the shooting was more intense than on Friday. Soldiers kneeled and fired carefully at individual demonstrators, they said.

Shouts of "Allahu Akbar," or "God is great," and "jihad," or "holy war," rang out. One man took off his T-shirt and shouted at the troops, "Shoot me, shoot me."

Time and again, the demonstrators reappeared from relatively safe havens in alleys to taunt the troops.

During one tear-gas barrage, demonstrators took advantage of a pall of smoke to drive four or five city buses into position blocking one of the main entrances to the square.

In an atmosphere of hysteria, demonstrators scooped up the wounded, loaded them into ambulances that drove off to hospitals sirens blaring.

"The army is shooting down our people," an enginner said. "We gave them flowers and they gave us back bullets. Now we are going to give them bullets."

Walking past the Contemporary Art Museum on the way back from the fighting, he muttered, "Look at these rich museums. They are good for nothing when people are living in hovels. We're going to get the guns and shoot back."

Among the wounded was Giancesare Flesca, a reporter for the Italian weekly L'Espresso, who was reported in satisfactory condition after suffering a shoulder wound.

Washington Post correspondent William Claiborne reported from Khomeini's exile headquarters at Pontchartrain, near Paris :

Khomeini condemned Bakhtiar today as an "agent of the shah" and declared with seeming finality that he will not meet with him unless he resigns first.

According to sources here, however, Bakhtiar will arrive in Paris Monday anyway.

Taking into account the unpredictable quality of Khomeini's stategy, however, the conflicting declarations could be a smokescreen for a meeting to negotiate Khomeini's demand for an Islamic republic, observers noted.

Khomeini today reiterated his charge that Bakhtiar's government is "illegal," and that if the prime minister is as nationalistic as he claims, "he must act according to public opinion."

"Why has he accepted the prime ministership in defiance of the whole nation? Why doesn't he resign and step aside," Khomeini asked as aides translated from Persian.

Reversing a statement last night by his chief aide, Ibrahim Yazdi, that a meeting with Bakhtiar had been agreed upon, Khomeini said, "I have said repeatedly that the depesed shah was illegal, the parliament was illegal. The government of Bakhtiar is illegal and those who are illegal I will not accept."

In an intervies, a close aide, Sadegh Ghotbzadeh, said some members of Khomeini's entourage had misinterpreted Bakhtiar's seemingly conciliatory statements in Tehran yesterday and believed the prime minister intended to resing before meeting the ayatollah.

"Now, to avoid misunderstanding, he should send a letter or announce to the press his resignation," Ghotbzadeh said.

He termed Bakhtiar's statement, "almost a resignation," and said, "It's all a question of whether he resigns inside or outside the door."