Amid mounting signs of armed insurrection, the Iranian government appeared to be shifting its stance today to allow exiled opposition religious leader Ayatollah Ruhollah Khomeini to return quickly to the country in an effort to avoid civil war.

Prime Minister Shahpour Bakhtiar announced that the country's airports, closed for the last five days to prevent Khomeini's return, would reopen Tuesday morning.

Despite the announcement, however, few Iranians see real hope of a compromise solution in light of mounting violence and the failure of past efforts by Bakhtiar to negotiate with Khomeini.

There were indications that those perils have convinced the government and military that they can no longer hope to overcome Khomeini's intransigence and therefore have moved to get Khomeini back into the country as soon as possible before demonstrations over his absence split the military and lead to a further deterioration of the situation.

In Paris, Khomeini's aides said the earliest the religious leader could return would be Wednesday. In the past week there has been considerable confusion fusion about the reopening of the airport, with officials first saying it would be opened and then canceling the announcement.

Sources in Tehran said plans were being made for a committee made up of both government officials and Khomeini representatives to welcome the ayatollah home after 14 years in exile.

The main question, however, was whether any move the fledgling Bakhtiar government made would be enough to forestall the disintegrating of state authority and increasing violence marked by an upsurge of anti-Americanism.

Informed sources reported this evening that a meeting between two senior generals and top Khomeini aides "made headway" toward reaching understanding about the form and timing of Khomeini's much-delayed return from exile.

There were no indications whether those at the meeting tackled the potentially even more explosive issue of what Khomeini could or could not do once back in Iran. Diplomats said this question was also on the agenda.

Against the background of the collapse of Bakhtiar's much-touted trip to Paris to see Khomeini, a senior Western diplomatic source worried that "it looks more and more as if the army and Khomeini are locked into a collision of forces without many avenues of escape left open."

Even as negotiators met, increasing signs of violence were discernible in Tehran and in the provinces.

In Rasht, near the Caspian Sea, two days of violence claimed five dead and 40 injured and $3 million worth of property damage.

In Tehran, troops opened fire and wounded at least seven demonstrators who burned two cinemas, two restaurants, a liquor shop, well-known bordellos and a nightclub. Tradional Moslems oppose drinking alcohol and modern forms of entertainment.

The demonstrators were seen chortling with delight as they threw champagne bottles from the club's cellar onto a boinfire.

Outside Tehran University, where at least 35 persons were killed by army bullets yesterday, gendarmerie Maj. Gen. Taghi Latifi was recognized despite a raincoat worn over his uniform. He was forced to stop his Mercedes 220, dragged out and badly beaten. [Hospital officials later reported Latifi in satisfactory condition after surgery, the Associated Press reported.]

An American Embassy staffer who asked not to be identified reported that Iranian soldiers guarding the embassy grounds had to be replaced with a fresh contingent after a soldier shoved an assault rifle into an American officer's belly and laughingly said, "Yankee go home." The other soldiers also laughed.

An embassy security officer arranged fot the changing of the guard, the disgruntled staffer said, and when the original 60-man contingent drove off in trucks, "They were all bellowing 'Yankee Go home,' and they were not funny anymore."

At Tehran University, thousands of milling Iranians read instructions posted on trees about how to make molotov cocktails or operate the J3 assault rifle issued to the Iranian army.

An unsigned tract distributed at the university entrance said the time had come to establish a "people's army" and attack the United States and Israel. It added: "We have to get guns."

Chanting demonstrators repeated, "machine guns, machine guns,the answer to all."

Another demonstrator said, "If you get hold of a gun, make sure every bullet counts. Don't waste bullets on showing off or even practicing. Save every bullet for hitting a soldier and getting his gun so you can hit 20 more."

Despite the increasingly shrill tone, a key Moslem cleric among hundreds conducting a sit-in to protest Khomeini's being kept out of the country, did his best to calm the crowd outside the university mosque.

Ayatollah Sayed Mohammed Beheshti, one of Khomeini's chosen negotiators, pointed to Bakhtiar's opening of the airport and Willingness to receive Khomeini under certain conditons as arguments against launching a jihad , or holy war, now.

But he warned that if Khomeini did not return soon, an armed struggle would ensue.

Many small groups were prepared and armed, he said, but "Ayatollah Khomeini will be the one to announce a jihad ."

Outside the university on Shah Reza Avenue, where much of yesterday's shooting took place, demonstrators surrounded dried pools of blood with concrete and red carnations. No police or soldiers were visible, although sizable contingents were stationed nearby.

Such was the emotional tension at the university that Simon Henderson, a British correspondent, had his chin slashed by a young man wielding a small knife after inquiring in English why another man was holding aloft a blood-stained hat. It turned out to belong to a man who had been wounded in yesterday's shooting.

On sale inside the unbiversity were photographs of Shah Mohammad Reza Pahlavi making a toast and Empress Farah dancing and wearing a one-piece swimming suit.

Even young girls whose blue jeans were visible beneath their anklelength Moslem robes, cackled over the photographs as proof that the royal couple's dissolute ways were counter to the teachings of Islam.

Also indicative of the rising tension were reports that doctors at Pahlavi Hospital had armed themselves with sticks and clubs on grounds that doctors in the northeastern city of Mashad had been attacked by proshah thugs in recent weeks.

A television camera man was beaten with sticks and his driver's arm was dislocated when they were attacked near the airport by assailants thought to be members of SAVAK, the secret police.

Against this background, the liberalism expressed by Bakhtiar in his news conference appeared at times utopian.

He said he would "do all to prevent" a civil war and "if people revolted I will be very firm."

"I may have other failings," he said, "but I am not afraid."

He tactfully excused Khomeini and his representatives in Tehran of any responsibility in the failure of his Paris mission. He blamed the ayatollah's entourage in Paris, "who leave much to be desired."

After the final detail of thee trip had been agreed upon here, he said, the Paris entourage in a dramatic turn of events "imposed the unacceptable condition" of his prior resignation as the price for seeing Khomeini.

He justified yesterday's massive military response to protests, saying, "when people are armed or half-armed and attack gendarmerie posts it is normal that troops shoot"

Washington Post correspondent William Claiborne reported from Paris:

Khomeini said he would return to Tehran as soon as the airports are reopened, despite warnings that his return would touch off renewed street fighting and probably a strong response from the army.

Replying to Bakhtiar's assurances that he could return once security measures were taken, Khomeini said in a statement read by an aide: "We don't ask any security from Bakhtiar or anyone else. God is the best protector of my safety. If there isany blood to be shed, I want to be among my people."

Just when, and if, Tehran's airport would open continued to confound Khomeini's supporters at the ayatollah's suburban Paris compound, as well as officials of Air France, which had been negotiating a charter flight to take the opposition leader home.

Conflicting reports about an imminent airport reopening prompted Khomeini aides to plan and then cancel a departure early Tuesday morning, and Air France canceled a regularly scheduled flight.