Iran's new military government last night announced the arrest of 12 former top officials after restoring a tentative calm with a formidable show of force in Tehran and the outlying provinces earlier in the day.

Among those arrested were five Cabinet ministers in previous civilian governments and the former head of Savak, the feared Iranian secret police.

Gen. Nematollah Nassari, a former key aid to Shah Mohammad Reza Pahlavi and head of Savak from 1965 until last June, last week had his passport impounded amid reports that he would be charged with murder, torture and misapporpriation of funds. Nassari was fired by the shah on June 6 but then appointed to the post of ambassador to Pakistan.

Nassari played a major role in the shah's return to power after his authority was challenged by leftist Prime Minister, Mohammed Mossadegh in 1953.

Also arrested were ministers of three previous governments, including former ministers of commerce, energy, information, rural affairs, executive affairs, the director of the Imperial Country Club and other former officials. All were charged with unspecified "illegal acts" and imprisoned.

The arrested former minister of information, Daryush Homayun, is brother-in-law of Iran's ambassador to the United States, Ardeshir Zahedi.

They are expected to be charged with corruption.

There were reports that the former managing director of Iran's national airline, Ali Mohommed Khademi, shot and killed himself in his home as he was about to be arrested by Savak agents. Striking Iran Air employes had demanded Khademi's prosecution as a condition of the settlement reached Monday.

Rifle crackled in south Tehran sporadically during the day as soldiers dispersed small groups of protestors. A fire believed set by saboteurs heavily damaged the National Gas Company headquarters here.

As municipal employes began cleaning central business district streets of charred hulks of burned automobiles and piles of debris dragged from banks, an eerie quietness covered much of the city. Many stores and offices remained closed in the aftermath of Sunday's spree of destruction by anti-shah protestors.

Meanwhile, all eyes turned toward Paris, where fundamentalist Shiite Moslem leader Ayatollah Khomeini appeared to hold the key to whether the shah's promise to hold free elections for a constitutional monarchy will be put to a test, or whether a military government will become institutionalized in Iran as it has in other major third world allies of the United States such as the Philippines and South Korea.

The government continued to profess a determination to press for a political compromise and a coalition government, but the opposition remained suspicious of the monarch's intention and continued to call for his removal.

The evolving situation represents a dilemma for both Khomeini and the shah.

If Khomeini agrees to negotiate a political solution with the shah, he will lose credibility among his supporters, because earlier this week he warned that any opposition political group that discussed compromise ment.

However, if Khomeini holds out for the shah's abdication as a prerequisite to forming a provisional government, he and the Moslem mullahs will become increasingly isolated from the moderate opposition, leading to a stalemate and the perpetuation of military rule.

Political observers here expect Khomeini and his followers to opt for a war of attrition against the government, with the expectation that an economic crisis fed by a continued wave of crippling nationwide strikes could stir enough unrest among middle class Iranians to ultimately drive the shah from his throne.

Similarly, the shah and his military Cabinet face a dilemma of their own making. If they maintain repressive martial law with severe limitations on freedoms, the government's professed desire for a democracy in Iran will be called into question by a distrustful public, and subdued bitterness will continue to smoulder.

If they ease restrictions as the previous government did after the Sept. 8 "black Friday" shooting of protestors by the army, the opposition will surface again and trigger a new round of protests and strikes.

In a short-term sense, the shah appeared to have achieved some success over the past few turbulent days.

Informed sources said the shah was under increasing pressure by his generals to stifle the insurections with harsh measures, but that he resisted because he believed a military solution would not have a long-term benefit.

During Sunday's Tehran riots, when scores of office buildings, hotels and movie theaters were sacked and burned, army troops within sight of the rioters were conspicuous in their inaction, which was widely interpreted here as a strategism to set the stage for a military government and intensified martial law.

Two persons who talked with the shah before and immediately after the decision to form a new government recalled the changes of mood shown by the monarch during the crisis.

In later summer, he seemed subdued and morose, almost resigned to an unhappy conclusion of his 25 years of single-handed rule over Iran and seemingly ambivalent about how it would come about.

While he apparently never considered abdication, the shah was said to be withdrawn and almost obsessed with the gloom of the situation.Later, according to those who saw him, he became almost frenetically involved in a search for a solution to the civil unrest, and showed signs of increasing tenseness and nervousess.

His restlessness escalated, his acquaintances said, until he realized that no political opposition group was willing to come forward and negotiate a compromise.

Then he was said to have calmed noticeably, becoming almost serene in his decisions to install a military government and noticeably relieved that his ordeal was over, for the time being at least.

Some observers were puzzled by last night's announcement of the arrest of 12 prominent Iranians. The move has led to speculation that they have been taken into custody for protective purposes.

Wire services reported the following related developments :

A Pan American spokesman in New York said the airlines was temporarily suspending operations in Tehran after evacuating 75 of its air and ground personnel from the Iranian capital. He said the action was taken "because we could not guarantee security for passengers and crew due to civil unrest."

U.S. officials in Tehran advised about 11,000 Americans residing in Iran to stay indoors when possible.