Loathed or lionized, the legendary Roy Cohn is dying a very public death.

The loathing is no secret: Sen. Joseph McCarthy's young redbaiter grew into one of the most feared and viciously successful lawyers in America. Thrice indicted, thrice tried and thrice acquitted here on various criminal charges, pursued for years by bill collectors and tax collectors, he is now battling disbarment for alleged fraud and professional misconduct.

Still, Cohn is the social lion, the toast of a certain set: President Reagan sends him warm greetings as he gets out of the hospital: "Nancy and I are keeping you in our thoughts and prayers." Well-wishers rush to embrace him at a Christmas party for the Cabinet and White House staff. Celebrities testify as his character witnesses. Columnists spring to his defense on the op-ed pages of New York papers.

Of what he is dying no one is certain. An affidavit from a physician at Sloane-Kettering Cancer Center refers to a "life-threatening disease" and gives the 58-year-old lawyer a likely six months to a year to live. Cohn said it is liver cancer.

Always a magnet for publicity -- whether as the boy-prosecutor in the Rosenberg spy trial or as a Mafia defense lawyer, whether squiring Cardinal Spellman around on his yacht or counseling J. Edgar Hoover, whether promoting heavyweight championships or throwing bashes at Studio 54 -- Cohn has done nothing to discourage the lurid fascination with what the tabloids are calling this "deathbed battle."

What might have been a mere family quarrel in the New York legal community has been fanned into an ideological struggle whose roots seem to stretch back more than three decades, unearthing old hatreds and ancient suspicions.

His accusers are "left-wingers," "a bunch of yo-yos just out to smear me up," Cohn has charged, and the bar panel is "a committee of lawyers, some of whom have always been deadbeats . . .

"It's a broad ideological question. Even some liberals are mad: What McCarthy was accused of practicing is actually being practiced against me."

Cohn's defenders see vindictiveness in the bar committee's pursuit of charges against a sick man. ABC newswoman Barbara Walters, a close friend, told the committee Cohn had wept uncontrollably at lunch with her in September, a side effect of treatment with the drug interferon.

"I think God has already punished him," she said. "Maybe he has been punished enough."

New York Times columnist William Safire, a lifelong friend who testified as a character witness, has led an attack on the panel he calls "Buzzards of the Bar." "Liberals with long memories are panic-striken that death may deny them their triumph," he wrote of the Cohn case. "Would a beloved left-winger be similarly harassed? Remembering the McCarthy era, perhaps you see poetic justice in this ghoulish pursuit."

Physically, Cohn can no longer practice law, his attorney Michael Mukasey said, thus the issue is "merely how Mr. Cohn's obituary will read -- whether he will be identified as a disbarred lawyer, one who was ultimately exonerated or one who died while charges were pending."

Normally, disbarment proceedings are secret. But after Cohn ridiculed the panel publicly, offering his side of the charges, the state supreme court, in an unprecedented decision Nov. 26, released 5,000 pages of records, covering 27 days of hearings and 48 witnesses.

"This was a case that was tried on the facts and the decision of the panel was made on the facts," said Michael A. Gentile, chief counsel to the six-member disciplinary panel, which recommended disbarment on Oct. 31.

According to the panel, Cohn took money from a $219,000 escrow fund in what a federal judge in 1976 declared to be "repeated and at times flagrant violations" of a court order; he refused to pay back a 1966 loan for $100,000 from a woman he had represented in a divorce case and then lied about it in a 1979 court suit; and he lied in a 1982 sworn application to the District of Columbia bar that he was not the subject of disciplinary proceedings elsewhere.

The charges, according to Cohn, are "not serious." He has contended that his law firm -- not he personally -- handled the escrow fund; that the $100,000 loan was an advance on future legal fees; and that the misconduct charges were not "formal" and thus did not have to be reported to the D.C. bar.

A fourth charge stemmed from a 1975 incident in which Cohn entered the hospital room of an ailing, 84-year-old client, Schenley Liquor magnate Lewis S. Rosenstiel, and had him sign a codicil to his $75 million will naming Cohn an executor. A Florida court invalidated the codicil after ruling that Cohn had "misrepresented" the document as relating to Rosenstiel's divorce. The bar panel dismissed this charge, believing it lacked sufficient proof, but Gentile has asked the court to reinstate it.

Before the committee record was made public, Cohn appeared to have scored a public relations victory. Even an old liberal such as Pulitzer Prize-winning columnist Murray Kempton questioned the "avenging angel of liberal prejudices," and commended Cohn's "reverence for the law."

Eight days later, after the hearing transcripts were released, Kempton did an about-face: "These pages give rise to the overmastering impression of a moral obtuseness that seems so close to congenital as to belong in the catalogs of the varieties of birth defect," he wrote in Newsday.

While Cohn and Safire invoke the historical ghosts of Left and Right, and the stiff-lipped lawyers of the bar mutter only about the misconduct charges at issue, the essential story of this struggle may lie in the tangled, torrid relationship that Cohn enjoyed with the legal establishment over his 37-year career.

"Mention the Association of the Bar and I throw up," he once told a reporter.

"I'm a name and they're not a name, so they're out to get me," he said of the bar panel in a telephone interview.

He said he had received 2,000 letters supporting him in the current battle. "I'm an iconoclast," he said. Liberals "don't like me and my allegiance for McCarthy and my theme of a strong America. But I feel I have done a lot for my country and for Israel," he added, noting that he had raised $4 million at an Israeli bond dinner recently.

A prodigy who had graduated from Columbia University and law school by the age of 20, Cohn was the only child of a respected state supreme court judge. At 27, fresh from a key role as a prosecutor in the Rosenberg spy trial, he became Joseph McCarthy's chief investigator, the brains behind the senator's brawn.

Twenty million people watched the McCarthy hearings on television. The image of Cohn, whispering in McCarthy's ear, badgering witnesses, railing against "Fifth Amendment communists" and traipsing around the world with his sidekick G. David Schine in an effort to uncover communists in American embassies was indelibly printed on the American consciousness.

"Bonnie, Bonnie and Clyde," was how playwright Lillian Hellman dubbed Cohn, Schine and McCarthy.

"Roy always had something of that manner of the serpent about him," said Irving Younger, an attorney and law professor who has dealt with Cohn. "He set people's teeth on edge, but he was extraordinarily brilliant and articulate."

Ultimately, Cohn hastened McCarthy's demise by pressuring the Pentagon for special treatment of Schine after he was drafted, and threatening to "wreck" the Army when enough favors were not forthcoming.

Cohn's rival on the committee staff was Robert F. Kennedy, the minority counsel. According to Younger, who was an assistant U.S. attorney under Robert M. Morgenthau in the 1960s, Kennedy and Morgenthau called Younger in and told him to "get" Cohn. After a nine-month investigation, Younger said, he was unable to pin anything on Cohn and gave up.

But Morgenthau, who calls Younger's account "absolute fiction," later tried Cohn three times -- in 1964 on stock swindle charges and in 1969 and 1971 on charges of extortion, bribery and blackmail of a city official, and filing false reports to the Securities and Exchange Commission.

Each time, Cohn was acquitted, and the tactics used against him -- his mail and his attorneys' mail was intercepted by the FBI -- bolstered his claims of "vendetta" and added to his mystique as invincible.

Cohn was also indicted in Chicago in 1970 for trying to secretly gain control of stock in two Illinois banks, but the charges were dropped.

During one criminal trial, Cohn's lawyer suddenly took sick and Cohn convinced the judge to let him make his own final arguments. Taking the stand without any danger of being cross-examined, Cohn spoke for seven hours, tears running down his cheeks. Several jurors cried, too.

"He was brilliant and he was the trickiest character in public life," said Washington attorney Joseph Rauh, who defended clients before the McCarthy committee. Rauh added that "the notion of a liberal vendetta in the disbarment case is nonsense. He is being investigated by conservative lawyers."

Cohn's battle against the bar panel is being waged with vintage Cohn techniques. Vituperative accusations on the one hand and, on the other, heart-rending pleas for pity delivered by 37 character witnesses, including a Catholic priest, three judges, an ambassador, Walters, William F. Buckley Jr., Rep. Mario Biaggi (D-N.Y.) and a double-amputee from the Vietnam war who said Cohn has supported him "financially and emotionally."

Thomas Bolan, Cohn's law partner and New York finance cochairman of the 1980 and 1984 Reagan campaigns, told the bar panel that Cohn is "a man of basic deep honesty . . . a man who loves people, loves animals. He once jumped into a river to save a dog in trouble. He is a man who likes to help the underdog."

Whether by charity or ruthlessness, brilliance or charm, Cohn's transformation from a man tarnished by the anti-McCarthy backlash in the 1950s and hounded by the law in the 1960s into a premier power broker of the 1970s and 1980s has been a remarkable feat.

Monsignor Eugene V. Clark, private secretary to Cardinals Spellman and Cooke, remembers Cohn frequently visiting Spellman, "who enjoyed his conversation . . . Roy knew just how things were going politically and socially in New York and would tell the cardinal in the most bipartisan way . . . Both cardinals were always interested . . . He gave that kind of very helpful advice. He was always willing to find out things, look things up."

It didn't seem to bother the church fathers that Cohn defended Anthony (Fat Tony) Salerno, Carmine Galante and other alleged mobsters, or that he specialized in vicious divorce cases.

Last year, Cohn described with relish his scorched-earth divorce case tactics to Manhattan, inc. magazine. "We got an order evicting her from the apartment, but she wouldn't go, so we just pulled up moving trucks, broke down the door, moved everything out of the apartment. But she wouldn't go. She got into the bathroom and locked herself in . . . I said, ' . . . In a couple of weeks we'll send somebody around to pick up the bones.' "

Donald Trump, grateful to Cohn for winning him a controversial tax decision for his luxurious Trump Tower, once enthused, "If you need someone to get vicious toward an opponent you get Roy . . . People will drop a suit just by getting a letter with Roy's name at the bottom." Trump testified for Cohn as a character witness before the bar panel, calling him "extremely loyal and extremely honest."

Cohn cultivated the press, thriving on celebrity and on combat. Gossip columnists featured him with such friends and clients as the Duke and Duchess of Windsor, Bianca Jagger, Warren (We Try Harder) Avis, Andy Warhol, George Steinbrenner, S.I. Newhouse Jr. and Benson Ford, the Ford Motor Co. heir. Geraldine Ferraro and New Jersey Gov. Thomas Kean attended his birthday parties. He spent weekends in Acapulco at the 32-room villa with indoor waterfalls that his client Baron Enrico di Portanova passed on to him after his battle for a Texas oil inheritance. In Provincetown, Mass., he occupied a house adjoining Norman Mailer's.

"When it comes to making headlines, I'm sui generis unique ," Cohn boasted. He made the cover of Esquire with a halo over his head. "60 Minutes" did a laudatory profile. Business boomed after another Esquire cover featured Cohn as "Legal Executioner."

He posed for People magazine playing a gilded grand piano, in a T-shirt inscribed "Super Jew." He posed on his fur-covered bed with the mirror over the ceiling. He showed off his autographed pictures from Ronald Reagan, his collection of porcelain frogs, his stuffed animals -- including teddy-bear-size devils with prominent genitalia. Everywhere, he was chauffeured in a Bentley, a money-green Rolls-Royce or a white Cadillac convertible.

Meanwhile, Cohn flaunted his reputation as the Houdini of tax entanglements. "Without question, I hold the world's record for having been audited by the IRS," he boasted. From 1959 to 1970, the IRS audited every one of his returns. Today, the IRS has $3.2 million in liens against him for unpaid taxes between 1959 and 1983. New York State says he owes $487,879 in back taxes and the City of New York is claiming $64,221.

Cohn is unabashed. When Manhattan, inc. in September listed $5.2 million worth of his debts, including court judgments against him ranging from $1.7 million in a business deal involving the Lionel Corp. to $258 owed to Tiffany & Co., an accompanying photograph showed Cohn with his empty pockets turned out of his pants.

The tax men and the bill collectors have a hard time with Cohn. He owns nothing -- at least nothing that teams of IRS agents, over decades, could ferret out. Houses in Manhattan, Acapulco, Greenwich, Provincetown and in D.C. (on Capitol Hill), as well as cars, yachts and a 12-seat private plane, are all owned by an intricate web of anonymous corporations, by the law firm or by close friends. He has testified that he has no bank account, no stocks, no assets.

But to support his jet-set life style, Cohn has said he takes an average of $500,000 a year in expenses out of the law firm, saying that his business life and his personal life are synonymous.

Under Reagan, an ideological soul mate whose campaigns Cohn vigorously supported, Cohn has reached a peak of influence. He made a splash in Washington with a 1980 inaugural bash and has been a frequent guest at the White House.

Today, even as he is dying, Cohn's bravado endures. "I'm not fit for the role of the complainer," he said. Death is an opponent like others he's faced over the years. As he has countless times before, he's decided to declare victory before the trial.

"I don't think these are my last days," he said. "I can't do as much water-skiing as I'd like. But when you have determination, it can help you physically and mentally."

In the coming weeks, he said, he is stepping up work on his autobiography -- of which he and journalist Sidney Zion have written more than 1,000 pages for Random House -- and planning trips to Palm Beach, Fla., and Acapulco. "And I am going into court tomorrow to tie up the loose ends of a very large matrimonial case." ("It's not Margaret Heckler," he joked.)

Tomorrow, however, was Saturday, when courts do not convene. Moreover, Cohn's attorneys in the disbarment case have been pleading for leniency on the grounds that Cohn is too ill to practice law.

Mukasey seemed puzzled by his claims of recovery. "It's unlikely," he said. "Do you believe in miracles?"