Hanafi Muslim leader Hamaas Abdul Khaalis was ordered to jail yesterday in a surprise decision by D.C. Superior Court Chief Judge Harold H. Greene after prosecutors charged Khaalis had been overhead in a police wiretap threatening to kill people.

The jailing ended 20 days of freedom for Khaalis, who led 12 Hanafi gunmen in seizing 134 hostages in three Washington locations earlier this month. Khaalis was then released withoiut money bond under terms of of an agreement negotiated before the hostages were released.

The arrest of Khaalis in a dramatic courtroom scene late yesterday afternoon was followed by the arrest at the courthouse of his son-in-law. Abdul Aziz, who has been the Hanafis' spokesman. Then, yesterday evening, U.S. Treasury agents with warrants searched two residences of Hanafis in Kensington and Hyattsville, looking for illegal guns.

Aziz, who was said in courtroom testimony to have just returned from an unexplained trip to Saudi Arabia, was arrested on a charge of illegally acquiring a firearm as a convicted felon, authorities said.

Khaalis was charged with violating one of the terms of this March 11 release - that he would take no action that might result in his arrest on other charges. "Threats to do bodily harm" are a violation of the D.C. code, prosecutors said.

Khaali's arrests took place in a general atmosphere of mounting tension among city officials as some officials were evacuated from the District Building and several federal buildings were placed on "gray alert."

Hanafi supporters in the courtroom appeared stunned and unhappy with the decision to jail the leader. The 11 other Hanafi gunmen who seized hostages earlier this month remain in jail.

The arrest followed a three-week period in which Metropolitan Police Chief Maurice Cullinane ad Capt. Joseph O'Brien were in almost constant contact with Khaalis.

U.S. Attorney Eark Silbert argues during the yesterday's 3-hour hearing that in "a court-authorized (telephone) intercept" the voices of Khaalis and Aziz had been indentified by federal investigators who were familiar with them.

Silbert said Aziz told Khaalis onthe telephone he had been questioned and searched by U.S. Customs officials upon his return from Saudi Arabia. Silbert said that Khaalis replied:

"I'll kill all on the same say federal agents intercepted another telephone conversation between Khaalis and an unidentified woman. Silbert said Khaalis told ber:

"They are going to pay in blood for it. I'm going to kill somebody. And they're going to die for what they did. It don't matter to me. I keep telling people. Now they're gonna pay."

Silbert argued that these statements violated the D.C. code prohibiting threats to do bodily harm and filed a motion to revoke Khaalis' conditional release.

At that point the routine, before Judge H. Carl Moultrie I, became dramatic. Chief Judge Greene was called in to preside. Two hours later, Greene ordered Khaalis jailed.

Greene said that "probable cause" existed that Khaalis had committed a new offense becaue Silbert had obtained from another Superior Court judge, William S. Thompson, an arrest warrant against Khaalis on the new charge.

Greene also said the government had showed that there was no reasonable way that it could be insured that Khaalis would not pose a danger to the community if his release were continued.

The threats picked up by the phone taps were "very serious," Greene said. "If these threats were stanling alone, they would not satisfy the standard that the government has to meet."

But the judge added:

"These threats don't stand alone. The fact is that Mr. Khaalis on previous occasions has made threats and carried them out."

"I cannot regard them as idle words. I think they are a realistic indication that the defendant, if he remained at large, poses a danger to the community."

When Khaalis was released on personal recognizance March 11, Silbert had said in court that the government had agreed not to seek money or surety bond for him "because of the danger at that time (of the seizures) - threats that heads would roll one person murdered, threats that blood would run ankle deep."

This agreement was negotiated between Khaalis and government officials late at night March 10 with the help of ambassadors from three Moslem countries.

Khaalis was released along with three other gunmen. But the release of the other three was not part of the original agreement and was revoked later after a judge heard a new testimony implicating them directly with injuring hostages.

The other eight gunmen were held on money bond from the begining.

Silbert and several top-level prosecutors had been holding lengthy closed-door meetings for two days prior to Khaalis' hearing yesterday, sources said. As they received the escalating threats they dicided they had no alternative but to seek the revocation of Khaalis' bond, the souces said.

At the same time, the prosecutors were said to be concerned about the possible violent reaction of Khaalis' followers when he was detained.

Because of that concern, prosecutors got an arrest warrant for Aziz, the souces said, and intensified surveillance on other Hanafi Muslims.

The original agreement to release the Hanafi leader on personal bond drew considerable criticism, but Attorney General Griffin Bell told a news conference soon after the release that he supported te agreement.

Bell said that Khaalis' principal demand had been that he be allowed to go home if he surrendered. Bell told reporters that he agreed to this but would not give Khaalis immunity.

Under the terms of his release he had to give up his support, was effectively prevented from making public statements, had to give up all firearms, was prohibited from leaving the Washington area and could not engage in any conduct that would result in his arrest on another charge.

While released, Khaalis charged with armed kidnapping. He was free pending possible grand jury action, and Silbert had said he would seek indictments on multiple counts of kidnapping, felony murder and numerous counts of assault and other crimes.

A Justice Department spokesman said yesterday that the Attorney General was not consulted by the local U.S. Attorney's Office prior to yesterday's court action. Silbert did consult the assistant attorney general in charge of Justice's criminal division who concurred with Silbert's decision to revoke the agreement.

While Khaalis' court hearing was under way yesterday, several members of D.C. City Council and their staffs evacuated themselves from the second and fifth floors of the Fistrict Building around 5 p.m. yesterday, apparently as the result of an anonymous phone call to staff members.

The security at the building was increased yesterday, but amid the general confusion it was difficult to pin down th exact nature of the phone call that caused much of the disturbance.

The District Building, the Islamic Temple on Massachussetts Avenue NW, were sites where the gunmen held a total of 134 hostages three weeks ago for nearly 40 hours.

During that time, one person was killed and dozens injured, some of them seriously. The gunmen threatened originally to kill many people unless several demands were fulfilled, but eventually backed down after Khaalis made his agreement with officials.

The incident was apparently motivated by Khaalis' rage agains the rival Black Muslim sect. members of which were convicted of killing members of Khaalis' family during a 1973 massacre. Originally Khaalis and his gunmen had demanded to have the killers brought before them, but this demand was dropped eventually.

Officials said that a "gray alert" for federal buildings in the city was activated shortly after noon yesterday. An official described "gray alert" as a "relatively low level" of security, the second in five levels of alert in which buildings guards impose a closer federal buildings.

Columnist Jack Anderson reported in a column in today's Post that prosecutors here rejected a request before the March 9 takeover by Treasury Department agents to search the Hanafi headquarters. Anderson said the agents had learned that there might be guns in the headquarters.

Persons familiar with the incident generally confirmed the story, but rejected any contention that approval of the warrant might have averted the heavily-armed hostage-taking incidents later.

Law enforcement souces said the Treasury agents had only information about two guns being inside the headquarters, and that prosecutors indicated to the agents that they did not think it was worth the possible risk to agents who might attempt to search the fortress like home.

Prosecutors also told agents at the time that a raid would unnecessarily antagonize the Muslim household at a time when the continued cooperation of key witnesses there was needed in the still in complete murder trials growing out of the January, 1973, mass murders there.

Until Silbert rose to address the judge at the afternnon court hearing, there was no indication the government was going to ask that Khaalis be jailed.

Former D.C. Superior Court Judge Harry T. Alexander, retained by Khaalis as his lawyer, filed a number of motions on behalf of Khaalis. Judge Moultrie gave the government five days to answer each of them and granted a motion by Alexander that the preliminary hearing be postponed to April 11.

Silbert then stood and asked that Khaalis be jailed because the intercepted telephone conversations constituted "threats to do bodily harm." Alexander, a flamboyant figure in a dark suit, gold-colored tie and matching handkerchief, with a gold chain around his neck, responded by asking for five days in which to answer Silbert's request. He also accused the government of acting in bad faith by not giving him prior warning of its plans.

Judge Moultrie said he could not rule on the government's request because he had not set the conditions of Khaalis's release. Chief Judge Greene had, so Moultrie sent for him.

Silbert reiterated to Greene his request that Khaalis's release be revoked. He stated repeatedly that the government had agreed to Khaalis's release in the early hours of March 11 only to secure the safety of the 134 hostages the Hanafis were holding.

"As we've made clear before, our agreement with Khaalis had nothing to do with our assessment of whether he was eligible for bail," Silbert said. "We did it only to save human life.

"The United States has stuck to the letter of this agreement, and if fully intends to do so. It is the defendant himself who has violated the conditions of release."

Were Khaalis to remain at large, it would pose "an unacceptable level of danger to the community," Silbert said.

Alexander replied that he "did not anticipate this kind of motion. I did not envision that in 1977 the government would utilize this type of action." Referring to the affidavit supporting the warrant for Khaalis' arrest, Alexander said, "This is a hot affidavit. This is a hot motion."

"What does that mean?" Greene interjected.

"That means it's quick," Alexander said.

Alexander demanded to see "the full wiretap" and the names of all persons whose telephones Judge Robinson had authorized the government to "bug."

The government then called its only witness, Sgt. Robert SHarkey Jr. of the D.C. police homicide squad. Sharkey recounted the circumstances of Khaalis' siege of the B'nai B'rith headquarters.

He also said he had first met Khaalis' on the night of Jan. 18, 1973, when seven Hanafi family members were massacred at their headquarters on 16th Street NW. Sharkey said that at the time of the massacre Khaalis told him he would allow the law to handle the situation. But Khaalis had added that if the law failed, he would take the matter into his own hands.

Sharkey said he also talked to Khaalis by telephone during the siege at B'nai B'rith this month and that the Hanafi leader had told him then:

"I told you I would get my revenge. This is only the third of four phases. The fourth phase you can't believe - you can't envision it."

Silbert told Judge Greene that the early March takeovers at B'nai B'rith, the District Building and the Islamic Center were the first three phases. He said the fourth phase had yet to come.

Sharkey testified that two hostages at B'nai B'rith had told him that Khaalis personally struck another hostage in the head and back with a weapon. He said the victim bled profusely from the head neck, that he had then been bound with his hands behind his back while facedown on the floor, and that he had been left in that position for 12 hours.

The detective said 16 firearms, "numerous knives," and "more than 10,000 rounds of ammunition" had been confiscated by police at B'nai B'rith.

In his cross examination of Sharkey, Alexander insisted repeatedly that the policeman refer to Khaalis and others as "mister." When he was a judge, Alexander made a reputation insisting that defendants before him be accorded such courtesies.

The courtroom was packed throughout the three-hour session. One bench in the spectators' section, reserved for members of Khaalis' family, was occupied by Aziz and three women, two of whom wore veils.

Security was heavy. The courtroom was ringed with U.S. marshals. D.C. police armed with high-powered rifles with telescopic sights took up positions in the Old Pension Building directly across the street from the court building where the hearing was being conducted.

A large crowd of spectators began gathering outside the courtroom nearly an hour before the hearing began. Each person was required to pass through a metal detector in a search for weapons before being permitted to enter.

Two men, believed to be Hanafi Muslims, were temporarily barred by deputy U.S. marshals. A decorated walking stick carried by one of the men was examined to determine if it contained weapon.

Aziz and Khadyja Khaalis, the defendant's wife, showed little emotion as they listened to the proceedings. On two occasions, Aziz left the courtroom briefly and returned.

After Judge Greene ordered Khaalis jailed, Mrs. Khaalis attempted to approach the defense table where her husband was. She was told by deputy marshals that Khaalis would not be permitted to speak to his family before being locked up.

After court was dismissed, the marshals asked all spectators and news reporters to leave the courtroom. Several persons, later identified as Hanafis, initially did not respond to the officers' request. But after speaking briefly with Aziz, the four men and a woman did leave the courtroom.

Mrs. Khaalis contacted by telephone at her home last night, said she was angry that her husband had been jailed. "The racist Jews got together and they railroaded him into prison," she said.

Asked if she expected that Khaalis would be held by the court, Mrs. Khaalis said: "i expect anything from Zionist racist Jews. This country hates Muslims. They (the government) act one way when the brothers come from another country because of the oil."

"(The government) puts on another face when they are dealing with us," she said. "As soon as the foreign Muslim brothers around the world find out that this country hates Muslims, things will start to roll."

Contributing to this story were Washington Post staff writers Scott Armstrong, Alfred E. Lewis, Timothy S. Robinson, B. D. Colen, Courtland Milloy, Joseph Ritchie, Lee A. Daniels, Richard E. Prince, Joseph Whitaker and Eric Westworth.