The summary trials and executions carried out in the heat of the first month of Iran's Islamic revolution were ordered by a hastily appointed public prosecutor who acted unchecked until he was dismissed last week, according to one of the key leaders of the revolution.

Sadegh Ghotbzadeh, a close aide of Ayatollah Ruhollah Khomeini, described the scramble to get the Moslem leader to order a halt to executions just hours before the revolution's most important prisoner, Amir Abbas Hoveyda, the shah's prime minister for 13 years, was scheduled to go before a firing squard without the authorization of any officials of the new government.

"Khomeini thought the Revolutionary Council was in charge and he didn't want to interfere," Ghotbzadeh said. "The Revolutionary Council thought the government was in charge, and the government thought it all had Kohmeini's approval.

"When the executions started in the provinces, we thought they were under the authority of the central revolutionary courts. We only realized what was really going on when we started protesting and asking who was ordering what."

Ghotbzadeh, now the director of Iranian state radio and television, explained that in the confusion of the early days of the revolution, the Khomeini-appointed Revolutionary Council named a revolutionary prosecutor general to take charge of the prisoners being held at Khomeini headquarters in a run-down girls' school.

The new prosecutor proceeded on his own to create the Tehran Revolutionary Court, according to this version. Responsible for the largest number of trials and immediate executions, the Tehran court served as a model for similar tribunals named all over the country by local Khomeini committees.

"They sprang up like mushrooms," said Ghotbzadeh, describing the action of local groups that assumed that the central authorities wanted them to do what was being done in the capital.

The first trials and executions took place shortly before midnight Feb. 16, just five days after the government of Prime Minister Shahpour Bakhtiar and the military had fallen. Four generals, including the former head of the shah's dreaded secret police, SAVAK, were shot by a firing squad ordered by the revolutionary prosecutor - reportedly once a victim of SAVAK torture himself.

"Frankly," said Ghotbzadeh, "no one was paying that much attention, and no one felt any pity or concern, not for the first four generals who were shot or for the next four generals [five days later]. The government was collapsing and we were trying to get control before it went over the brink. No one gave a damn about a few executions here and there."

Altogether, 62 former officials of Shah Mohammad Reza Pahlavi's government were summarily executed, including 21 generals. The evidence suggests that the leadership was happy enough to let the prosecutor dispense summary justice as long as he was executing alleged torturers and mass murderers but that the tide turned against him when he started sending political offenders before the firing squad.

Liberal and middle-class opinion, which has since turned against the executions, expressed satisfaction over the first executions. After the first group, the English-language daily Kayhan International headlined across eight columns at the top of its front page the single word, "Retribution." Its editorial that day was headlined, "They Lived and Died by the Gun."

The prosecutor, Ghotbzadeh said, chose fellow victims of SAVAK torture as judges for his court. He said they have all since been dismissed and are being replaced by professionals. He refused to reval the prosecutor's name, saying that the man was a sincere revolutionary who had thought he was doing the right thing. The prosecutor apparently has been replaced by Mehdi Hadavi, a veteran judge.

The prosecutor could act as he did, Ghotbzadeh said, because there are no clear lines of authority between the Revolutionary Council named by Khomeini and the provisional government of Prime Minister Mehdi Bazargan. The issue came to a head just before the final 11 executions in Tehran.

Until then, the government and council members both assumed without question that the prosecutor was acting on authority from the other body, Ghotbzadeh said.

Ghotbzadeh said he asked Kohmeini by telephone last Friday morning to halt the trials and that he did so immediately. Bazargan had gone to see Khomeini at his residence in Qom the evening before with a similar plea. Kohmeini issued orders to suspend all trials in Tehran and all executions elsewhere.

"He was the only one who could stop it," said Ghotbzadeh. "A few hours later, I assure you, Hoveyda would have been gone."

The Hoveyda trial will resume in a few weeks with a reinstituted court following new procedures, Ghotbzadeh said. CAPTION: Picture, Two Kurds point to mortar damage to a building in Sanandaj, in western Iran. AP