A week of demonstrations throughout Iran has left the government harried, but Shah Mohammad Reza Pahlavi is firmly in control and apparently planning to turn the resulting unrest to his own advantage.

Antigovernment disturbances so far have broken out in at least 55 cities, towns and villages in Iran. The latest civil unrest surrounded a March 30 day of mourning called by Moslem leaders to honor people killed by army troops during demonstrations in the northwester city of Tabriz in February.

The recent rise of Moslem religious leaders' latent power to contest secular authority and assert their influence has evidently croded much of the shah's support. Nevertheless, he still has the firm loyalty of the army and police forces, the bureaucracy and the well-to-do.

Most diplomatic observers and dissidents agree that the shah has more than enough resources to crush any serious challenge to his regime. He appears, however, to want to ease the lid off iranian society just enough to let off some steam so that it will not explode when he evidently turns power over to his son. Crown Prince Reza, 17.

According to official accounts, the most recent unrest resulted in at least five deaths and 98 arrests when "foreign-inspired" mobs attacked police. Political opposition sources said more than 30 persons died after police fired on demonstrators in two provincial towns. Neither version could be confirmed independently.

There are also sharply differing accounts of a rare hunger strike by political prisoners in the capital's QASR prison, the largest in the country. According to dissidents, the prisoners are now in their fourth week of the strike and are threatening to start refusing even to drink water if their demands are not met. They are insisting that they either be granted new trials before civilian courts or released, dissidents said.

They said there are more than 100 strikers, but government sources indicated that there are fewer than 20 and all were jailed for serious crimes. The Foreign Ministry denied that a hunger strike was even going on.

A local dissident group, the Committee for the Defense of Human Rights in Iran, has formally charged that striking prioners have been beaten by guards as punishment and warned that prisoners' lives may be in danger.

The U.S. National Council of Churches has sent the committee a telegram of support expressing "grave concern for the physical safety and health" of the prisoners and urging the government to grant them cuvil public trials. They were convicted by military tribunals of crimes against the state, but dissidents and authorities dispute the nature of their offenses.

The latest unrest was the second set of disturbances to take place at 40-day intervals sin ce police fired on a crowd of religious demonstrators in the holy city of Qom Jan. 9. Moslems traditionally hold mourning ceremonies on the 40th day after a death.

The religious leaders had appealed for nationwide bazaar strikes and mosque ceremonies to be held "in peace and discipline." According to official reports, however, riots broke out in numerous places and small groups of people attacked public buildings, usually smashing windows but sometimes setting fires. Favorite targets have been banks and local offices of the Rastakhiz party, created when the Shah decreed a single-party system in 1975.

Most of the incidents were relatively minor, but major demonstrations occurred in the central city of Yazd and in the town of Jahrom in southern Iran.

The government said police fire killed at least two persons in Yazd and one man in Jahrom after water hoses and tear gas failed to disperse attacking mobs. It said that in separate incidents in two other provincial cities a fourth demonstrator died of wounds and an alleged terrorist was killed. In a shootout.

Dissidents said about 20 persons were killed in Yazd and at least 12 in Jahrom.

Political opposition leaders accused the government of fabricating or exaggerating reports of the latest violence. In a letter to the prime minister, they said the government has been "totally silent" on various peaceful demonstrations while giving unusually broad publicly to disturbances in a bid to frighten the public. The oposition said authorities as a pretext to suppress legitimate dissent "in the guise of maintaining law and order."

Information Minster Dariush Homayoun called the charge "ridiculous" and blamed the current unrest on the political dissidents.

"They have become ashamed of what they have been doing," he said. "They realize the adverse reaction of the public and are trying to blame the government."

Both the political and religious opposition in Iran have publicly repudiated the violence and denied that they encourage it.

"We don't agree with actions like this," one dissident said.

Dissident leaders and many other Iranians suspect the government of instigating at least some of the incidents to discredit the opposition, but they are unable to offer any proof.

Regardless of demonstrators' affiliations, the government has shown a desire to make political capital out of the disturbances and rally the population to its support. Another aim is apparently to bolster the Rastakhiz party, which officials concede has been greeted largely by apathy and has failed to attract significant support from the people.

The Foreign Ministry has created a "guidance and information committee" associated with the Rastakhiz to expose what a spokesman called "increased subversion against our country."

The party has started to set up action committees in provincial cities to combat sabotage and vandalism. Officials said the groups would be for "political action rather than vigilante-style security."

In addition, the party just published a statement accusing "silent onlookers" of failing to "fulfill their patriotic duty of fighting hooliganism, rabble-rousing and looting and even embellishing such incidents in cocktail party gossip."

The shah has claimed that there is "an unholy alliance" between his left-wing political opponents and right-wing Moslem critics whom he calls "red and black reactionaries."

Dissidents in Tehran dismiss this allegation, saying it is absurd to think conservative puritanical Moslem leaders would join forces with Marxists.

Diplomatic observers tend to agree. A link between political and religious opposition does exist, they say, but it basically reflects efforts to disorganized moderate political dissidents to ride the coattails of the powerful religious leadership, which commands the obedience of a vast majority of Iran's 34 million people.