A Montgomery County Circuit Court judge ruled yesterday that Edward Thomas Mann, accused of killing three persons last May at the IBM building in Bethesda, is not mentally competent and therefore will not now stand trial on the murder charges.

The ruling, which followed six days of conflicting psychiatric testimony, will send the 38-year-old Mann to a mental hospital, where he will remain under criminal court jurisdiction for at least 10 years. Mann could still face trial if his condition improves, and he cannot be released at any point unless a judge finds that he is no longer dangerous to himself or others.

Judge William C. Miller's ruling came after a steady stream of psychiatrists testified that Mann was suffering from a severe mental disorder, called paranoia, which resulted in a feeling that IBM, Mann's former employer, was conspiring to destroy his life. Miller found that Mann believed that even his attorneys and the court were part of that conspiracy and therefore Mann could not properly assist in his own defense.

"It is not really the decision I'd like to make," Miller said as he looked out at the crowded courtroom, "but it's the only one I can make with any intellectual honesty."

The decision, at least for the present, ends the bizarre chain of events that were set off last May when Mann allegedly rammed his Lincoln Continental through the glass lobby of the IBM building where he once worked, and then blasted away with a machine gun in a wide circle, killing three persons and injuring nine others.

The ensuing siege ended after seven hours of sporadic negotiations with police and Mann's wife, Rosa. After police granted his last demand--that he empty his automatic weapon into a picture on the office wall that portrayed a court scene--Mann surrendered peacefully.

Mann subsequently was indicted on three counts of murder and 23 of assault, and his case was set for trial. But last fall, as the trial date drew closer, he fired the prominent Washington lawyer he had hired, changed his plea from not guilty by reason of insanity to guilty, and said he wanted to defend himself without a lawyer.

Judge Miller, however, refused to accept the plea. Noting Mann's bizarre behavior, including a recent suicide attempt in his cell at the Montgomery County Detention Center and repeated requests that he be executed, Miller set hearings--rarely held in criminal cases--to determine whether Mann was mentally competent to stand trial. It was on that issue that Miller ruled yesterday.

Mann fought the hearings all the way, even complimenting the prosecutors during the proceedings when they made points to bolster their case against him. "The state did a great job," Mann told the judge as the hearing ended Tuesday.

Yesterday, after the judge completed his ruling, Mann stood up, turned to his wife, shook his head and mouthed "Goodbye" to her, Rosa Mann later told reporters.

"I know he was telling me goodbye," Rosa Mann said outside the courtroom, "and he will probably try to commit suicide, which he has promised."

The reaction to the ruling among survivors of the IBM siege ran the gamut from anger to understanding.

IBM employe John Dickenson, who said he was "looking down the barrel of the gun at one point" last May 28, declared: "I believe once a criminal does something like this, he should lose some of his constitutional rights. Then you wouldn't have all this loophole-finding. But as long as he doesn't get off scott free . . . there is still hope for justice."

A female IBM worker, who asked not to be identified, felt that treatment, rather than punishment, would be the fairest thing for Mann. "I think the system would have done him in had he gone to trial,." she said.

During the hearings, four psychiatrists called by the prosecution agreed that Mann suffered from paranoia, but said it did not encompass the court system. They concluded that Mann was mentally competent to stand trial.

Yesterday, prosecutor Michael Mason argued that Mann could "function adequately as a defendant," that his condition "will deteriorate," and that a trial now would "give Mr. Mann his day in court."

Six experts, called by the defense, disagreed, asserting that Mann was using the court proceeding and his guilty plea to expose IBM and make some sort of statement about the plot against him.

Judge Miller agreed with that opinion. Mann, he said, believes the "object of the trial is to be his statement about IBM , and not the determination of his guilt or innocence."

Under yesterday's ruling, Mann will be returned to the Clifton T. Perkins State Hospital, where he has been held since attempting suicide.

Under Maryland law, Mann's condition will be reviewed periodically and, if it improves, he could be tried on the criminal charges. The murder charges will remain in force for at least 10 years. After that, a judge could dismiss them, although defense attorney Carol Freeman said that is unlikely.

Under no circumstances could Mann be released unless a judge found that he was no longer mentally ill and no longer dangerous to himself or others, Freeman said.

Mann had worked his way up at IBM from computer trainee in 1966 to marketing representative in 1979, when he resigned after becoming increasingly disenchanted with the company. Mann lodged an official complaint that IBM was discriminating against him because he was black, but became increasingly introverted and bitter when that complaint was dismissed by the D.C. Office of Human Rights, his wife has said.