Rampaging anti-shah rioters paralyzed Iran's capital yesterday, burning banks, hotels, movie theaters and government office buildings as the rebellion against the monarchy accelerated and the government teetered on the verge of collapse.

There were reports that Prime Minister Jaafar Sharif-Emami had resigned, but they could not be confirmed early this morning.

The press spokesman for the imperial palace, denying that any change of government was imminent, said last night that martial law would be intensified today and rioters will be dealt with "harshly."

This was apparently a change in policy, since yesterday Iranian Army troops looked on while mobs of enraged youths roamed through the city; burning and sacking scores of buildings, including the British Embassy, and burning automobiles in an eight-hour spree of unrestrained violence.

There were no official reports on the number of casualties.

A pall of thich black smoke hung over the city and tanks patrolled key streets. Although most of the rioters were young people, thousands of other Iranians indicated support for the rebellion by turning on their headlights, sounding their horns and driving through the streets shouting, "Death to the shah."

It was the first time since the current disturbances began that a cross section of middle-class Iranians in large numbers openly expressed support for the overthrow of Shah Mohammad Reza Pahlavi.

The shah has made no public appearances or statements for several days. He is understood to be at his palace in a section of Tehran several miles from yesterday's rioting.

Two cabinet ministers - the heads of education and science - resigned in protest over government action during the crisis, but their withdrawal alone did not signify a fall of the government.

Officials of the opposition Iranian National Front, which has a shadow cabinet prepared to step in as a provisional government, suggested that the army deliberately allowed the situation to get out of hand yesterday to make a wholesale crackdown more palatable to moderates.

As thousands of demonstators, many carrying wooden staves and rocks, poured out of Tehran University downtown campus and headed for the central business district, heavily armed soldiers stood at key intersections and watched the parade pass by.

At the height of the riot, when buildings were being burned, the army made only sporadic attempts to disperse the crowds and protect the buildings. During the entire siege, No fire equipment responded to the blazes, which were allowed to burn uncontrolled or were battled by private citizens.

Shortly before a 9 p.m. curfew took effect last night, however, raily armored military units rolled into the central district, and troops fanned out through the main streets chasing away the few remaining protesters.

Several tanks were brought into the area, and automatic weapons fire could be heard from the west end of the city. Army tanks were reportedly stationed near the Iranian radio and television building. Tanks also blocked approaches to the heavily guarded U.S Embassy.

The state-controlled radio, which has given only sketchy accounts of the rebellion from its beginning, canceled its news broadcasts when the curfew was moved back three hours in an attempt to clear the streets.

On Saturday, Iranian Army troops opened fire outside the university campus, leaving a confirmed toll of three dead and touching off a wave of attacks on downtown buildings, but not nearly as widespread as yesterday.

The protest yesterday began quietly when several thousand students gathered in front of a mosque at the university to mourn the deaths of students killed Saturday. At the end of the services, they began streaming out of the main gate of the campus and were joined by other demonstrators in a march toward the central district.

The march broke up into numerous small bands of youths, who began smashing windows of banks and attacking movie theaters, which are traditional targets of Moslem activists because of Islamic prohibions against usury and violating the "image of the soul" on film.

The Radio City Cinema of Pahlavi Street, a large modern structure, was one of the first to be burned. Flames shot up for hundreds of feet minutes after several youths ignited a canvas tarpaulin and threw it inside the building.

Half a dozen major hotels that cater to foreigners were attacked by the mob and heavily damaged. They include the Imperial Hotel, the Royal Garden (formerly Sina) Hotel, the Versailles and the recently opened 13-story Waldorf Hotel, whose lower floors were gutted by fire.

At the Waldorf, about 75 guests who were stranded on the roof were rescued by a hugh crane on a construction site next door which was maneuvered to position a boom over the top of the burning hotel so a work man could carry out a spectacular rescue operation viewed by the demonstrators below.

The crane lowered a pallet to the roof and picked up the guests five at a time as they lay down on the platform and clung to the cable while being swung through the air. The workman then had the pallet lowered to the windows of the hotel, where he made similar rescues.

At the Imperial Hotel; the manager saw the demonstrators coming, and took large portraits of the shah and the royal family, threw them to the sidewalk and trampled them to the cheering of the crowd. Some youths rushed into the lobby anyway and smashed windows and furniture.

In numerous office buildings, other employes threw pictures of the imperial family out of window.

Witnesses to the British Embassy attack said a crowd went to the gate of the compound, smashed windows of a gatehouse and went into the four-story building, warning employes to leave before they set a fire. The building was damaged by the blaze, and another fire reportedly broke out in a garage at the north end of the compound.

The nearby U.S. Embassy was protected by Iranian troops stationed at both ends of the boulevard in front of the compound.

Throughout the day, Iranian soldiers interrupted similar small gestures of hatred for the shah. Some even stopped cars and flailed at the headlights that were lighted as an expression of support for the protesters.

The troops seemed to deliberately avoid crossing te pats of the protesters, and many fewer soldiers were on the streets than on Sept. 8, when hundreds of demonstrators were shot in a confrontation at Jaleh Square.

Occasionally yesterday, the rebellion took on a carnival atmosphere as protesters dragged furniture from buildings and lit huge bonfires in the middle of the street. Bank records and rolls of computer tape showered the street like confetti as rioters and passers-by waved at each other in heady exuberance.

"The shah is finished, write that," said one youth to a reporter, smiling broadly and running his finger across his throat.

Meanwhile, strikes spread throughout the country, as workers continued demanding an end to martial law and freedom for all political prisoners.

Oil refineries and pumping facilities remained partially shutdown, and gasoline filling station operators refused to work in support of the oil workers.

The staff of the Central Bank of Iran struck yesterday, and the telecommunications workers, who have been on strike, threatened to cut off all communications in Iran if their economic and political demands are not met.

Iran Air remained on strike, and there were reports last night that Tehran's airport may be shut down today to all international flights by other carriers.

The two Cabinet ministers who resigned were Education Minister Manouchehr Ganji, who complained of government weakness during the crisis, and Higher Education and Science Minister Abulfazi Qazi Shariat-Panahi, who protested Saturday's shootings at Tehran University.