Samuel S. Leibowitz, a celebrated defense attorney whose clients included "The Scottsboro Boys" and gangster Al (Scarface) Capone, and later a judge who sometimes referred to defendants as "rats," died in a Brooklyn, N.Y., hospital Wednesday following a stroke. He was 84.

Before 1940, whom he took the bench in Kings County, N.Y., which is better known as Brooklyn, Judge Leibowitz gained a reputation as one of the most effective criminal lawyers in the United States. By his own count, he defended 140 persons charged with murder.Only one was executed.

Those who were acquitted included Capone, who went on to become czar of the Chicago underworld; a man accused of the "mercy slaying" of his 16-year-old retarded son; a woman who said she shot her lover, a German businessman, in self-defense after he proposed that she perform an unnatural act; and Harry L. Hoffman, who was convicted three times of murdering a 35-year-old Staten Island, N.Y., mother. Judge Leibowitz took the latter case without charging a fee and won Hoffman his freedom at a fourth trial.

He declined to represent mobster "Lucky" Luciano against charges of compulsory prostitution. He also declined to represent several members of "Murder. Inc.," against murder charges, although he reportedly was offered a $250,000 fee. He refused to defend Bruno Richard Hauptmann, who was edecuted for the kidnap-slaying of the infant son of aviator Charles A. Lindbergh, although he visited Hauptmann in his death-row cell three times.

The case in which Judge Leibowitz took the greatest pride was that of "The Scottsboro Boys." They were nine young blacks convicted of raping two white women in a freight car in Paint Rock, Ala., in 1931. All nine were sentenced to death by an Alambama state court in 1933.

It was at that point that the future Brooklyn judge entered the case.He stayed on it for four years, although he took no fee. He took the case to the U.S. Supreme Court and argued that the trial had been illegal because qualified blacks systematically were excluded from jury service in Alabama. The Supreme Court agreed with him. The result of that ruling was that the barring of blacks from jury service became illegal, although the practice persisted for many years in some parts of the country.

Religious and racial feelings ran high and the case became a cause celebre. Judge Leibowitz gained an international reputation. But all nine defendants again were convicted at the close of the new trial that followed the Supreme Court ruling, even though one of the alleged victims changed the story she had told at the first trial.

Rape charges against five of the nine eventually were dropped, although one of these was sentenced to a lengthy term for stabbing a prison guard. The other four remained in jail in connection with their convictions for rape.

Clarence Norris, the last survivor of "The Scottsboro Boys," was pardoned in October, 1976.

"Mr. Leibowitz was a beautiful man," Norris said Wednesday in New York, where he now lives. "He really did a job for me and the rest of the fellows. The world is a little different now and he helped change it."

Judge Leibowitz received numerous threats during his involvement in the case. "It takes more than a crowd of hooded bigots to scare a Jew-boy from the sidewalks of New York," he said at the time.

He took the bench in Kings County Court for the first time on Dec. 22, 1940. Within two months, he had sentenced a convicted murderer to death.

From then until his retirement in 1969, Judge Leibowitz had a reputation as being one of the toughest judges in New York. He used the same eloquence with which he once had persuaded juries to return verdicts of "not guilty" to berate prosecutors, defense attorneys, police officers, defendants, and, sometimes, other judges.

In 1960, he suggested that Judge Nathan R. Sobel, who dismissed a murder indictment against a youthful defendant by saying that it never should have been brought in the first place, should "keep his filthy mouth shut." The indictment had been returned by a grand jury under Judge Leibowitz's supervision.

In the early 1950s, he supervised a grand jury that returned indictments against 18 New York policemen who allegedly took bribes from bookmaker Harry Gross. At the trial of the policemen, over which Judge Leibowitz presided, Gross refused to testify. The judge cited him for contempt 60 times and sentenced him to five years in prison and a $15,000 fine.

An interviewer once asked Judge Leibowitz how he reconciled his spectacular career as a defense attorney with his ater role as a judge.

"I never consorted with them in the first place," he said of his former-clients. "They never slapped me on the back and called me 'Sam.' I looked upon them as a doctor would a case. I have defended men who on the surface looked guilty, men on the doorstep of the deathhouse who were later proved to be absolutely innocent."

On another occasion, he told an interviewer that his criminal practice had taught him "what you do with a dangerous snake. If you couldn't take the fangs out, at least you put him away where he can't bite anybody."

In an emotional ceremony in his courtroom on the occasion of his retirement, a tearful Judge Leibowitz said, "They spoke of me as a tough judge. Well, (my wife) can tell you how nights went by when I tossed in bed until dawn trying to figure out what to do with the poor devil to be sentenced in the morning."

Judge Leibowitz was born in Jassy, Romania. His family moved to New York when he was 4. At that time, his father changed the family name from Lebeau to Leibowitz. They finally settled in Brooklyn, prospered and the future judge graduated from Cornell University Law School in 1915. He was admitted to the bar in 1917, and set up his own practice, specializing in criminal law two years later.

While a judge, he twice ran for mayor of New York. Both efforts were unsuccessful.

In 1919, he married the former Belle Munves. She survives him and lives at the home in Brooklyn. Also surviving are a daughter, Marporie; twin sons, Robert and Lawrence, and two grandchildren.