Harry C. McPherson Jr., a Texas-born lawyer who as a principal adviser, speechwriter and confidant to President Lyndon B. Johnson influenced a range of policies, from civil rights to the curtailing of bombing in Vietnam, died Feb. 16 at Suburban Hospital in Bethesda. He was 82.

He had complications from cancer. The death was confirmed by Hedrick Smith, a journalist and family friend.

A self-described “Southern liberal” steeped in New Deal politics, Mr. McPherson was a Washington legal mandarin at the center of the capital’s power elite for decades. He spent his post-White House years with what became Verner, Liipfert, Bernhard, McPherson and Hand — a practice he helped transform into one of the District’s prominent lobbying shops.

Verner, Liipfert merged in 2002 with what is now DLA Piper, and Mr. McPherson worked there until 2010. As one of the firm’s “wise men,” he helped represent media companies, airlines and foreign governments. In the late 1990s, he played a public role in the firm’s efforts to help leading tobacco manufacturers reach a settlement with the government over smoking-related lawsuits.

Long after he left the Johnson administration, Mr. McPherson remained a presence in the District’s political, cultural and civic life. He wrote a memoir, “A Political Education” (1972), that remains among the most enduring portraits of power in the capital, seen at first from the fringes when he was a newcomer from Texas and then from the epicenter at the White House.

Louis Lyons, the late journalist and curator of Harvard University’s Nieman Foundation, reviewed “A Political Education” for the Christian Science Monitor and called it “a portrait of a man gifted with extraordinary insight and the capacity to put politics in perspective, and with an appreciation of the humanity and commitment of public men, striving through frustrations and fickleness to make democracy work.”

“A Political Education” piquantly detailed the clay feet of nearly everyone in politics he had met. Mr. McPherson did not spare himself, noting moments when he lost sight of his “political morality” in the desire to please charismatic leaders.

In the crucible of the White House, Mr. McPherson developed strong reserves of forbearance working for a president who favored a “bear-pit school of personnel management.” Johnson enjoyed keeping underlings off balance with his sharp temper and demanding ways. Nonetheless, Mr. McPherson deeply admired Johnson’s adroit political instincts and his colorful way of expressing them.

To Johnson, powerful lawmakers were “whales,” and he needed but a few to succeed in any legislative showdown. He once castigated Mr. McPherson for having rounded up “all the minnows.”

Over time, Mr. McPherson said he came to regard a certain detachment — a balance of “fervor and humor” — as crucial personality traits for anyone hoping to succeed in Washington.

An aspiring poet in his youth, Mr. McPherson changed his professional ambitions in the early 1950s when he felt an ardent passion to defend those being targeted by Sen. Joseph McCarthy (R-Wis.) as communist sympathizers. “I was worried that he was going to usher a period of totalitarianism in the United States,” Mr. McPherson told an interviewer in 1999.

Fresh from the University of Texas law school in 1956, he settled in Washington and apprenticed in the Senate under majority leaders Johnson (a fellow Texan) and Mike Mansfield of Montana. Able and perceptive, Mr. McPherson briefly held ranking jobs at the Pentagon and State Department before joining the Johnson White House in 1965.

Then 36, he became Johnson’s personal lawyer and a lead speechwriter. Joseph A. Califano Jr., a White House colleague, said Mr. McPherson was one of the president’s most trusted advisers.

“He was the president’s counsel at a time when there was only one counsel,” Califano said. “Now there are probably 25 lawyers over there.”

Mr. McPherson had a role shaping speeches affecting a range of domestic initiatives, including civil rights, inner-city rebuilding, poverty relief and other social programs. He was centrally involved in Johnson’s efforts to reach out to minority groups, including African Americans and Jews.

Working with Defense Secretary Clark Clifford, who saw the war as a catastrophic mistake, Mr. McPherson became a key ally inside the White House to pause bombing in North Vietnam in the hope of negotiating with the enemy.

Mr. McPherson played a significant role shaping some of the president’s most important speeches on Vietnam — most notably Johnson’s nationally televised address on March 31, 1968.

In that talk, the president announced that he would scale back the bombing in North Vietnam. Johnson then made a surprise declaration at the end of the speech that he would not run for reelection that year.

To Mr. McPherson, this also was a surprise — although he had been privy to Johnson’s mulling over his prospects in the race because of a nation splintered over war and race riots.

“To this day, Johnson is still the smartest man I’ve ever met, although maybe not the wisest,” Mr. McPherson told the law publication Bar Reports in 1999. “He more or less threw in the towel. . . . When it was finally over, and he left the White House, I was exhausted. I saw him off on inauguration day, as he left Washington. As I watched him get on the plane, I felt officially powerless, and oddly, relieved.”

Harry Cummings McPherson Jr. was born Aug. 22, 1929, in Tyler, Tex. In that oil-rich area of eastern Texas, his father ran a sporting goods store. His grandfather was the town banker and kept a picture of Franklin D. Roosevelt over the bank vault.

Harry Jr. graduated in 1949 from the University of the South in Sewanee, Tenn., and attended Columbia University for graduate work in English literature. He left Columbia in 1950 to serve in Germany with the Air Force during the Korean War.

After his White House service, Mr. McPherson was recruited to lobbying practice by one of his closest friends, Berl Bernhard, a venerable Democratic Party hand. Over the years, Mr. McPherson helped bring other political insiders to the firm, including former senators Robert J. Dole, George J. Mitchell and Lloyd M. Bentsen, and former Texas governor Ann Richards.

In 1997, Mr. McPherson attracted criticism for the firm’s role representing tobacco companies including Philip Morris and RJR Nabisco. At the time, state attorneys general were suing the industry for billions of dollars to recoup tobacco-related Medicaid expenditures.

Negotiations on Capitol Hill collapsed, and the industry settled with all state attorneys general in 1998 for more than $200 billion paid out over 25 years.

Accepting Big Tobacco as a client — and the millions of dollars that came with it — was jarring for many even at the firm who had long identified Mr. McPherson with progressive politics.

“We agreed to do it because we thought it made a lot of sense in terms of the public interest and, secondly, because it was very handsomely compensated work,” Mr. McPherson told The Washington Post in 1999.

In addition to his legal work, Mr. McPherson sat on commissions to examine the Three Mile Island nuclear accident in 1979 and military base closures in 1993. Among other affiliations, he was a past president of the influential Federal City Council civic group and the Economic Club of Washington, and past vice chairman and general counsel of the Kennedy Center.

His first marriage, to Clayton Read, ended in divorce.

In 1981, he married Patricia DeGroot, an interior designer. Besides his wife, of Kensington, survivors include two children from his first marriage, Coco McPherson of New York and Peter B. McPherson of Nashville; and a son from his second marriage, Samuel B. McPherson of New York.

Mr. McPherson was known for a puckish sense of humor that he fearlessly directed at Johnson on occasion.

As a young staffer on Capitol Hill, Mr. McPherson was asked to prepare questions for a hearing on State Department appropriations and deliver them to then-Majority Leader Johnson.

When Johnson summoned him to the dais, he proudly made his way behind other senators and bent his ear by Johnson’s mouth expecting praise. The senator whispered, “Go up to my office and get me a few of those orange sourballs.”

He got the candy and sealed it in a manila envelope so tightly that Johnson would have to disrupt the hearing every time he wanted a sourball. “Every rip was so loud, there was no way to open the envelope quietly,” he told Bar Reports. “He glared at me, and I just smiled. That was my revenge.”