Armed youths roamed the streets of Tehran in defiance of orders to give up their guns today and clashes between rival anti-shah groups led to fears their victory could deteriorate into a revolution within a revolution.

While Ayatollah Ruhollah Khomeini's forces clearly had won control of Iran's major institutions -- most importantly the government and military -- it was obvious his provisional government had little control over the fighters who staged the revolution's latest chapter in the streets over the weekend.

Some radical guerrilla groups, which previously had been small and confined to a shadow existence, emerged reinforced and well-armed from the three days of street combat that toppled the government. Khomeini's mainstream forces took over Shah Mohammad Reza Pahlavi's palace and remaining holdout military installations, but their provisional government was still seeking to consolidate its power and end the anarchy.

The ousted prime minister, Shahpour Bakhtiar, went into hiding under the protection of his successor, Mehdi Bazargan, who reportedly guaranteed Bakhtiar safety before Bakhtiar resigned yesterday.

Bazargan's government seized the apparatus of the state and repeatedly appealed over the "Voice of the Revolution," formerly Radio Iran, for the bands of street fighters to turn in their weapons. But if anything, the fighters were more heavily armed today than they were during the previous day's bloody fighting for control of an Air Force training base in east Tehran.

The enormous volume of arms on the streets -- including .50-caliber machine guns and antitank weapons -- raised fears that after the common enemy has been eliminated, rival insurgent groups will turn their weapons on one another in a struggle for power.

Captured Army trucks packed with rifle-toting street fighters raced through downtown Tehran throughout the day as urgent requests went out over the radio for rebel reinforcements at besieged military installations.

The former Air Force commander, Lt. Gen. Hussein Rabii, said at a news conference that Iranian planes and other sophisticated weapons remain in the country, intact under control of the new government.

"All the weapons are here," he said. "Nothing has left the country."

The force includes U.S.-made F14 Tomcat fighters, among the most advanced in the world, equipped with high-technology Phoenix missiles, also U.S.-made. There had been reports that Egypt offered to shelter the fighters and their missiles during the struggle for control of the country.

The major conquests today were the exiled shah's lavish palace in the northern outskirts of Tehran and the sprawling, heavily fortified Lavizan Army Garrison, headquarters for the Iranian ground forces and the shah's Imperial Guard.

In both instances, the Imperial Guard surrendered without a fight, leaving the revolutionaries without any significant military opposition in the capital.

Insurgents also seized the Sultanatbad Army garrison, stormed Tehran's Evin Prison and released hundreds of inmates and captured a large American military advisers' center in north Tehran.

At the U.S. military center, which had been evacuated by Americans, defending Iranian Army troops ran away before a shot was fired, with many of the soldiers immediately joining the rebel street fighters.

In the provinces, Army resistance was said to be firmer, with heavy clashes reported in several towns. In Rasht, on the Caspian Sea, civilians set fire to headquarters of SAVAK, the secret police, and shot at agents, as rebels elsewhere in the country appeared to take the Tehran uprising as a signal to attack pro-shah troops and police.

The commanding general of the Iranian ground forces, Gen. Abdol Ali Badrei, was reported killed by fellow officers at the military staff offices because he intended to capitulate. Other officers killed were Gen. Bokrat Jafarian, the military governmor of Khuzestan Province whose helicopter was reported shot down near Ahwaz, and Lt. Gen. Mohammed Amin Biglari, deputy commander of the Imperial Guard's elite Immortals Division who was found shot to death early today in his Tehran home, an Army spokesman said.

Lt. Gen. Manouchehr Khosrowdad, head of Army aviation, fled the country in a helicopter, the rebel-held state radio said. The revolutionary government closed all Iran's borders and shut the airports in an attempt to prevent the escape of other top generals and former government officials.

The runways of Tehran's Mehrabad Airport were obstructed with tanks and other vehicles.

In his first major appointment Bazargan fired the chief of the supreme commander's staff, Gen. Abbas Karim Gharabaghi, and replaced him with a dismissed Army intelligence chief, Gen. Mohammed Ali Gharani.

While he made some appointments to his own staff, Bazargan still has not named a Cabinet, although some portfolios are expected to be announced Tuesday.

Bazargan did, however, move into the prime minister's office, which was guarded by insurgents in rag-tag uniforms and carrying a variety of weapons.

Rebels seized from prisons a number of former high-ranking officials who previously had been arrested on corruption charges, including former prime minister Amir Abbas Hoveyda, and the former SAVAK head, Gen. Nematollah Nassiri. Nassiri was put on public display tonight at Khomeini's headquarters in an "interview" broadcast on television.

The shah's Niavaran Palace fell to the rebels at 10:30 a.m. without a shot being fired, as about 60 Imperial Guard troops put down their weapons and walked out the gates.

Witnesses said the rebels gave the guards civilian clothing, kissed them and "told them they are our brothers." Most of the Imperial Guards simply walked away, the rebels said, but a few joined street fighters.

Kamel Shirazi, who lives nearby, said he took one palace guardsman home and gave him food.

"He was quite upset. He said he was under a lot of pressure for the last few weeks by the officers, who told him the shah was still in the country and would return to the palace. He was crying, but he was glad it was over," Shirazi said.

A captured tank stood outside the palace gate, with a white sheet hanging from its cannon barrel. The royal seal at the entrance had been covered with pictures of Khomeini. Several hundred persons stood behind roped barriers and stared in disbelief at the captured royal home.

Inside the grounds, dozens of armed rebels patrolled the gardens and prevented reporters from entering the building. Although opposition leaders sent Moslem clergymen to the palace to prevent looting, some furniture reportedly was taken out and deposited at a mosque.

In another incident, offices of the U.S. International Communications Agency, formerly the U.S. Information Agency, were ransacked by street fighters. Damage was light, officials said, and American diplomats already had abondoned the facility, which is separate from the U.S. Embassy proper.

There were occasional clashes between contending insurgent organizations, including shooting sprees at the Hilton Hotel and the Intercontinental Hotel, Tehran's largest. While there were conflicting accounts of both incidents, the common denominator appeared to be a lack of central command.

The attack on the Hilton began when a group of rebels thought they had been fired upon by a sniper. They returned the fire and then searched the rooms and interrogated the guests before posting a squad in the lobby to "protect" the hotel.

The rebels held captive for most of the day a number of employes of Bell Helicopter International, which had been using the hotel as an evacuation staging center.

At the Intercontinental, two groups of fighters went on a shooting rampage, which was described variously as a misunderstanding or a feud between rival groups.

Bullets crashed through the windows of the hotel, where about 200 foreign correspondents are staying.

The rebels said they were there because Khomeini wanted to protect the hotel and its occupants.

Some rebels described the shootout at the Intercontinental -- which lasted about 40 minutes -- as a case of mistaken identity, saying one of the groups was thought to be Communists. Others claimed the group was Cherikhaye Fedaye Khalu, a Marxist group with ties to radical Palestinian groups in Beirut. Despite the intensity of the fighting, no casualties were reported.

Persistent radio reports during the day that American Marines had helped Iranian soldiers defend some installations led to growing animosity against Westerners, with street fighters routinely menacing reporters with rifles and shouting, "Yankee, go home."

Although uncontrolled insurgents roamed the streets picking up Americans on sight, once the captives reached the Khomeini headquarters compound, they were given an apology by the opposition leaders and turned loose.

About 23 Americans -- including Bell Helicopter employes and Marines -- were seen being escorted out of the compound under armed guard.