Hamaas Abdul Khaalis and 11 other Hanafi Muslims convicted of armed kidnaping and related offenses in the seizure of three Washington buildings last March were sentenced yesterday to terms that will keep most of them in prison for the rest of their lives.

Khaalis, the leader of the group and one of three defendants convicted of murder as well as other crimes, was sentenced to serve 41 years to 123 years in prison. Khaalis, who became 55 on Aug. 30, will not be eligible for parole consideration until he has served at least 41 years.

Judge Nicholas S. Nunzio of D.C. Superior Court gave the longest sentence - 78 years to life - to Abdul Muzikir, 22, also known as Marquette Anthony Hall, who fired a blast of double-O buckshot that killed one man at the District Building and wounded two others. He fired another blast into the back of a hostage who was lying on the floor with his hands bound, crippling him for life.

"The sentence means that you will die in jail," Nunizo told the impassive Muzikir.

The least of the terms Nunzio gave out was 24 years to 72 years to one of the three Hanafis who took hostages at the Islamic Center at 2551 Massachusetts Ave. NW in the heart of the city's "Embassy Row." Nunzio noted that the "terror" at the Islamic Center was "psychological" rather than "physical," as it had been at the District Building and at the third building taken over, the international headquarters of B'nai B'rith, the Jewish service organization, at 1640 Rhode Island Ave. NW.

U.S. Attorney Earl J. Silbert told a reporter later that he was "very satisfied with the appropriately severe sentences imposed by Judge Nunzio." He said they would serve to deter 'terrorism.'

Silbert also noted that none of the defendants conceded any guilt or any wrongdoing either during the trial or at their sentencings.

Extraordinary security precautions were employed in and around the small courtroom where the sentencings were held. Spectators were searched with metal detectors when they sought admission to the courtroom, which is a model of these built in the new building into which the Superior Court is to move next year.

The prisoners were taken first to a third-floor cellblock. Then they were taken, one by one, to the courtroom on the floor below. After each had been sentenced, he was taken from the building with no opportunity to talk to any of his codefendants.

Judge Nunzio asked the Justice Department to assign each of the 12 to a separate U.S. prison so that no two ever would be together. He said these locations would be announced when the prisoners had reached their destinations.

Additional special arrangements were made for Khallis. He was taken by U.S. marshals from the courthouse, put on a chartered aircraft and flown to a federal facility in Illinois. Court officials said he had arrived at his destination before the last of the Hanafis had been sentenced at 12:52 p.m. Khaalis set the tone for what the other Hanafis told Nunzio yesterday.

"Today America is in very, very, very grave trouble," he said, "and nobody seems to listen. These problems are grave problems and you need my assistance. You need help bad.

"We've strayed so far that the people laugh and smile when they see homosexuals. God destroyed them - Sodom and Gomorrah . . .

"Whatever happens is the will of Allah," he said.

Harry T. Alexander, the former Superior Court judge hired to defend Khaalis, described his client as "a leader of the Muslim faith." He said that Khaalis be placed on probation.

Alexander read a cable he said he had received from Dr. Mostafa Momen, adviser to the Islamic Center in the United Arab Emirates, which said that "we Arabs in the Arab world bear witness that Khalifa (leader) Hamaas is a true Muslim leader who stood for the character and respect of Islam and he showed mercy by releasing 129 souls."

Alexander also said a "compassionate sentence" would aid the cause of peace in the Middle East and "enhance" U.S. relations with that part of the world.

Finally, he argued that Khaalis never intended to commit a specific crime in leading the takeover of the buildings, in which 149 hostages were seized.

Having heard from Alexander and Khaalis, Nunzio pronounced sentence on Khaalis. For eight counts of armed kidnapping at the B'nai B'rith building, where Khaalis was present, eight consecutive sentences of five to 15 years. For conspiracy, one to three years consecutive to the kidnapping terms. For murder in the second-degree of Maurice Williams, a 24-year-old radio reporter shot down by Muzikir at the District Building, 15 years to life imprisonment, concurrent with the other sentences. For assault with intent to kill Mack W. Cantrell, a guard wounded by the same blast that killed Williams, five to 15* years, and for assault with intent to kill Robert J. Pierrce, shot in the back as he lay on the floor while a hostage at the District Building, five to 15 years, both sentences concurrent with each other and with the other sentences. For each of eight counts of armed kidnapping at the District Building and at the Islamic Center, five to 15 years, the sentences to run concurrently with the other sentences.

"So, in effect, sir, your sentence is 41 to 123 years," Nunzio said.

Khaalis said nothing. Then he turned abruptly, made a military salute to a dozen Hanafi women, most of whom were wearing black veils, in the spectators' section. The women waved back, but made no sound. Khaalis, who looked thin and drawn compared to his appearance during the trial, quietly left the courtroom.

Alexander told reporters later that he thought Nunzio had been "harsh." He later placed a telephone call to Robert Lipshutz, counsel to President Carter, to ask that Khaalis be considered for a presidential pardon.

A White House spokesman said later that "it is not appropriate for (Lipshutz) or the President" to involve himself in the case since it is under appeal.

As each defendant followed Khaalis before Nunzio, he proclaimed that he was a citizen of the United States, a patriot, and a follower of Khaalis who would swear that what Khaalis said was true until death. Each proclaimed that he would concede nothing. Each asked for probation.

In sentencing, Nunzio closely followed the rationale of the verdict returned by the jury of two men and 10 women July 23 at the close of a trial that began May 31.

The government charged that the 12 Haanafis engaged in a conspiracy - which is an agreement to do an illegal act - to carrying out kidnappings. The government said the purpose of the kidnappings was to gain hostages who would be held to force officials to turn over the to the Hanafis five Black Muslims convicted of murdering seven members of Khaalis' family in 1973. The murders occurred at the Hanafi headquarters at 7700 16th St. NW.

A further purpose of the hostage-taking, according to the government, was to stop the showing in this country of the movie "Mohammad, Messenger of God" on the grounds that it was sacreligious.

To this end, Khaalis and six other Hanafis took more than 120 hostages at the B'nai B'rith building about 11 a.m. on March 9. An hour and a half later, three other Hanafis seized a dozen hostages at the Islamic Center. About 2 p.m., two Hanafis took 15 hostages at the District Building.

For reasons of judicial economy, the government charged only eight counts of armed kidnapping at each of the three locations. Since the prosecution also charged conspiracy, each of the 12 was charged with all the acts carried out in furtherance of the conspiracy. This is because of the legal principle that holds that the acts of one conspirator can be attributed to all conspirators.

The jury found Khaalis guilty of all the crimes with which he was charged on the grounds that he was the leader. They then found each of the others guilty of conspiracy and of those acts in which they had directly participated. They found them innocent of acts for which they could have been held responsible by reason of the conspiracy theory of law.

In sentencing, Judge Nunzio gave the longest sentences - the consecutive sentences - for crimes in which each defendant had taken a direct part.

Besides the penalty given to Khaalis, he gave the following terms to Hanafis who had been at the B'nai B'rith building: Abdul Adam, 31, also known as George W. Smith, 44 to 132 years; Abdul Latif, 34, also known as Carl E. Roper, 36 to 108 years; Abdul Shaaeed, 23, also known as Marvin Sadler, 36 to 108 years; Abdul Salaam, 31, also known as Clarence White, 40 to 120 years; Adbul Hamid, 22, also known as Hilvan Judge Finch, 36 to 108 years; Adbul Razzaaq, 23 also known as Nelson McQueen Jr. and as Norman Lee, 40 to 120 years.

The Islamic Center defendants and their sentences were: Abdul Rahman, 38, also known as Clyde Young, and Adbul Rahim, also known as Phillip Young, 26, 28 to 84 years; Abdul AlQawee, 22, also known as Samuel Young, 24 to 72 years.

The only Hanafi at the District Building besides Abdul Muzikir, the trigger man, was Abdul Nuh, 28, also known as Mark E. Gibson. He received a sentence of 58 years to life imprisonment.

Under District law, the minimum portion of any sentence must be served in full before the prisoner is eligible for consideration for parole.