Federal prosecutors asked yesterday that 12 Hanafi Muslims convicted of armed kidnapping and related offenses in the seizure of three Washington buildings be sentenced to life imprisonment as a warning that terrorism will be answered by severe punishment.

For Hamaas Abdul Khaalis, 55, the leader of the group, the government asked for penalites totaling 123 years to life in prison for five counts of armed kidnaping, on count of murder in the second degree, two counts of assault with intent to kill, and one count of assault with a dangerous weapon.

The most lenient penalty it sought for any of Khaalis' codefendants was 45 years to life imprisonment.

The recommendations were made in a memorandum filed with Judge Nicholas S. Nunzio of D.C. Superior Court. It was signed by U.S. Attorney Earl J. Silbert and by Assistant U.S. Attorneys Martin J. Linsky and Mark H. Tuohey III, the two prosecutors in the case.

Judge Nunzio is scheduled to sentence all 12 Hanafis on Sept. 6. All 12 were found guilty July 23 by a jury of 10 women and two men at the close of a trial that began May 31.

"In the view of the United States, the prolonged period of terrorism, brutality and intimidation for which these defendants have been found responsible by a jury warrants the most serious sanctions which lawfully may be imposed for such conduct," the government memorandum said.

"In imposing sentence on these defendants, we respectfully ask this court to put these defendants and other potential terrorists on notice that the use of terror to achieve private ends will be dealt with severely, and that those who use terror to victimize innocent persons do so at the risk of forfeiting their right ever again to be free in society," it continued.

It singled out Khaalis as "the planner of the entire operation. It would not have happened but for him. He bears the major responsibility for all that occurred."

What occurred was the taking of 149 hostages on March 9. They were seized at the international headquarters of B'nai B'rith, the Jewish service organization, at 1640 Rhode Island Ave. NW; the Islamic Center, at 2551 Massachusetts Ave. NW, in the heart of the city's "Embassy Row," and at the District Building, the seat of the city government, at 14th and E Streets NW.

Most of those taken hostage were held until the early hours of March 11.

More than a dozen of them were injured at the B'nai B'rith headquarters, including Alton W. Kirkland, who was stabbed and slashed, and Wesley A. Hymes, who was slashed and shot.

But the worst violence was at the District Building. Maurice Williams, 24, a reporter for radio station WHUR, was killed by a blast of double-0 buckshot fired by Abdul Muzikir, 22, also known as Marquette Anthony Hall.

The same blast wounded Mack W. Cantrell, a guard at the District Building who has since died of a heart ailment, and City Councilman Marion S. Barry Jr. Robert J. Pierce, a retired State Department official who was serving as a City Council intern, was shot in the back by Mizikir. At the time, Pierce was lying on the floor with his hands bound behind his back. He is paralyzed from the waist down.

The government charged that Khaalis and his followers took the hostages to try to force authorities to turn over to them five Black Muslims convicted of murdering seven members of Khaalis' family at the Hanafi headquarters at 7700 16th St. NW in 1973.

A second purpose, the government said, was to stop the showing in this country of the film "Mohammad, Messenger of God" on the grounds that it was sacrilegious to the Hanafis' beliefs.

Since the government charged all 12 defendants with conspiracy, which is an agreement to do an illegal, act, it charged each of the 12 with every crime that resulted from the conspiracy. This is because of the legal principle that the act of one conspirator is attributed to all conspirators.

Thus, each was charged with 24 counts of armed kidnaping-eight where hostages were taken. Each was charged with murder in the death of Maurice Williams and each was charged with assault with intent to kill in the wounding of Cantrell, Barry and Pierce.

Each also was charged with assault with a dangerous weapon on Wesley A. Hymes at the B'nai B'rith building.

Abdul Adam, 31, also known as George W. Smith, was charged individually with the wounding of Alton W. Kirkland at B'nai B'rith. This was because prosecutors considered the attact to be outside the scope of the conspiracy.

In rendering its verdict, the jury found all 12 guilty of conspiracy. But it convicted only Khaalis of all the crimes with which he was charged in the indictment. For the rest, it found them guilty of the acts in which they participated directly. It found them innocent of the crimes of which they were accused only by reason of the conspiracy theory of law.

The government followed the jury's reasoning in the sentencing memorandum it filed yesterday.

After asking the severest penalty for Khaalis, it asked for sentences totaling 90 years to life imprisonment for Abdul Muzikir, the gunman at the District Building, and for Abdul Nuh, 28, also known as Mark E. Gibson, the only other Hanafi who was the District Building.

For Abdul Adam, the Hanafi who attacked Kirkland at the B'nai B'rith headquarters, the prosecutors recommended 51 years to life.

For the five Hanafis who were at the B'nai B'rith in addition to Adam and Khaalis, they recommended 48 years to life imprisonment.

For the three involved in the takeover of the Islamic Center, where the least violence occurred, they asked for 45 years to life imprisonment.

Judge Nunzion is not bound by any of these recommendations when he sentences the 12. CAPTION: Picture, SOLOMON SCHWEITZER . . . $185,000 stolen last year