John J. Wilson, 84, one of this city's most respected trial attorneys by virtue of his love of the law, his mastery of its intricacies and a style of advocacy that was sometimes abrasive, sometimes charming, generally resourceful and always forthright and outspoken, died of heart ailments May 18 at his home in Washington.

In 1973, Mr. Wilson gained national attention representing Nixon White House aides H.R. (Bob) Haldeman and John D. Ehrlichman in the Watergate hearings conducted by Sen. Sam Ervin (D-N.C.). The following year, he defended Haldeman against criminal charges of conspiracy, obstruction of justice and perjury.

Judge John J. Sirica, an old friend and colleague of Mr. Wilson from the days when both were assistant U.S. attorneys, eventually sent Haldeman to prison for six months.

At the time of the Watergate trials, Harry Huge, an attorney who was an opponent of Mr. Wilson in a case involving mismanagment of the United Mine Workers of America pension fund, offered this assessment of his adversary: "I thought him very nasty and petty at first. But he just fights like hell for his client. And once you get over that rough, gruff exterior, it's a pleasure to deal with him. He tells you what he's going to do and does it."

Another attorney in the Watergate case said of Mr. Wilson: "He's like my old Irish grandfather. Most of the disparaging things that are said about him I consider as compliments."

Mr. Wilson said of himself, "Isn't it funny? I'm the meanie. I'm the whipping boy. I said to somebody the other day, in the egotistical way that I possess, that the one thing they don't say about me is that I'm not smart."

Watergate was not Mr. Wilson's only celebrated case. In 1952, he represented Youngstown Sheet & Tube when President Harry S Truman tried unsuccessfully to take over the steel industry in a labor dispute.

As an assistant U.S. attorney in the 1930s, he prosecuted Bishop James Cannon Jr. of the Southern Methodist Church, a vitriolic anti-Catholic. The bishop and his secretary were accused of violating the Corrupt Practices Act in the 1928 election in which Gov. Alfred E. Smith of New York, a Catholic, was the Democratic presidential nominee. The jury said they were innocent.

In the late 1930s, Mr. Wilson successfully prosecuted Emmitt Warring, a numbers king in the District of Columbia. As he was being led to the cellblock, Warring called out to the prosecutor. "I went back there," Mr. Wilson recalled in an interview with The Washington Post, "and he put his hand out and said, 'John, I just want to thank you for a fair trial.' "

Of less note outside the legal community was Mr. Wilson's lengthy and successful representation of the Swiss firm Interhandel, one of whose subsidiaries had been confiscated by the government during World War II on the theory that the subsidiary was supplying the Nazis.

Other clients included the Washington Gas Light Co., the National Rifle Association, the Acacia Mutual Life Insurance Co. and the Cafritz Co.

John Johnston Wilson was born in Washington. He graduated from the old National Law School, now part of George Washington University. He was 20 years old and he had not gone to college -- "I'm one of those badly educated people," he used to say. Because of his age, he had to wait a year to take the bar examination.

Admitted to practice, he joined the old firm of Tucker, Kenyon & MacFarland. In 1931, with the onset of the Great Depression, he went to work in the U.S. Attorney's Office in Washington. In 1940, he joined what became Whiteford, Hart, Carmody & Wilson. Since about 1977, he had been of counsel to the firm, which is to say in semiretirement.

In an interview with The Post in 1974, he said the law had changed in the previous 20 years and that he was glad of it. An acknowledged master of procedure and tactics, he said that substance had come to "prevail over technical defenses. That, undeniably, has been progress. But I lost something when that happened."

Mr. Wilson was a fellow of the American College of Trial Lawyers and a member of the American, D.C., and federal bar associations. He was a trustee of George Washington University and was made an honorary doctor of laws by it in 1978. He was a past president of the Barristers and Lawyers clubs and a member of the Metropolitan Club.

His first wife, the former Alice Adelaide Grant, died in 1978.

Survivors include his wife, Betty Tyler Wilson of Washington, and one stepdaughter, Dr. Mary Craddock of Arlington.