Bearded Cuban leader Fidel Castro confers with E. Barrett Prettyman Jr., fourth from right, in Havana during 1962 negotiations to release prisoners taken in the Bay of Pigs operation. (JOE MCGOWAN JR./AP)

E. Barrett Prettyman Jr., a Washington lawyer who had an advisory role in the Supreme Court’s landmark 1954 decision Brown v. Board of Education, which outlawed segregated schools, and who decades later investigated congressional corruption in the Abscam case, died Nov. 4 at a hospital in the District. He was 91.

The cause was a respiratory ailment, said his son, E. Barrett Prettyman III.

Mr. Prettyman, whose father was a prominent D.C. jurist, was a law clerk to three Supreme Court justices in the 1950s, an assistant to Attorney General Robert F. Kennedy and, in later years, a mentor to current U.S. Chief Justice John G. Roberts Jr.

In 1962, Mr. Prettyman negotiated with Cuban leader Fidel Castro for the release of prisoners taken in the ill-fated Bay of Pigs operation, and his clients later included General Motors, acclaimed writers such as Truman Capote and former Beatle John Lennon.

Mr. Prettyman’s contribution to the Supreme Court’s 1954 Brown v. Board of Education decision was unknown until author Richard Kluger described it in his 1976 book about the case, “Simple Justice.”

E. Barrett Prettyman Jr. in 2005. (Susan Biddle/The Washington Post)

At the time, Mr. Prettyman was a clerk to Justice Robert H. Jackson, who had drafted a separate opinion in support of the court’s unanimous decision regarding segregated schools. After reading Jackson’s concurring opinion, Mr. Prettyman realized it could be seen as, at best, a lukewarm endorsement of the full court’s ruling.

He composed a sharply worded memorandum in which he urged Jackson not to publish his separate opinion.

“I told him quite candidly,” he said in a 1996 interview with the Historical Society of the D.C. Circuit Court, “that I didn’t think much of the opinion, that it sounded more like a dissent than a concurring opinion.”

He argued that Jackson’s separate opinion would only undercut the force of the court’s unified ruling. Jackson ultimately agreed, and the opinion was never published.

“It is doubtful,” Kluger wrote in “Simple Justice,” “if any of the many excellent young men who have come fresh out of the law schools . . . to serve the justices of the Supreme Court ever served more faithfully or usefully than Barrett Prettyman served Robert Jackson.”

Jackson died soon after the Brown decision, and Mr. Prettyman continued at the Supreme Court as a clerk to Felix Frankfurter and later to John M. Harlan. He is believed to have been the only person to serve as a law clerk to three justices in succession.

In 1955, Mr. Prettyman joined the Washington law firm of Hogan & Hartson (now Hogan Lovells), where he took on First Amendment and death-penalty cases and established the firm’s appellate practice. He argued before the Supreme Court 19 times. Among the dozens of lawyers he mentored at Hogan Lovells was Roberts, who was named chief justice in 2005.

E. Barrett Pretty Jr., right, with his late sister, Courtney Paddock, left, and U.S. John Warner (R-Va.) in 1997. (Susan Biddle/The Washington Post)

In 1961, Mr. Prettyman published “Death and the Supreme Court,” a nonfiction study of legal cases involving the death penalty. It won the Edgar Allan Poe Award for best factual crime book. He later accompanied one of his clients, Capote, across the country for a series of interviews with death-row inmates.

In the early 1980s, Mr. Prettyman was special counsel to the House Ethics Committee during the “Abscam” investigation, in which several congressmen were convicted of accepting bribes from a would-be Arab sheik in an undercover FBI sting.

Mr. Prettyman recommended that Michael Myers (D-Pa.) be expelled from the House of Representatives after he was caught taking $50,000 in cash.

“He used his influence as bait and barter to wring huge sums of money from those he thought could use his office,” Mr. Prettyman told the House committee, adding that Myers made “a mockery of the seat in which his constituents placed him.”

Myers was the first member of Congress to be expelled since the Civil War.

Elijah Barrett Prettyman Jr. was born June 1, 1925, in Washington. His father was a chief judge of the U.S. Court of Appeals for the D.C. Circuit Court. The U.S. Courthouse in the District is named in his honor.

After graduating in 1943 from the private St. Albans School in Washington, the younger Barrett Prettyman served in the Army in Europe during World War II. He graduated from Yale University in 1949.

He spent two years as a newspaper reporter in Providence, R.I., before attending law school at the University of Virginia, where he became friends with a fellow student, Robert F. Kennedy. He received his law degree in 1953.

In 1998 and 1999, Mr. Prettyman worked pro bono as inspector general of the District of Columbia, rooting out corruption in city agencies.

“It’s the best job I ever had,” he said at the time. “Every time you think you’ve seen every scam and scoundrel that could possibly come down the pike, you’re surprised by a new one.”

His marriages to Evelyn Savage and Victoria Keesecker ended in divorce. His third wife, Noreen McGuire, died in 2011. Survivors include two children from his first marriage, E. Barrett “Ty” Prettyman III of Oakton, Va., and Jill Prettyman Lukoschek of Houston; and three grandsons.

Mr. Prettyman was a collector of rare books and served as president of the PEN/Faulkner Foundation, which presents awards to writers, from 1990 to 1993. He had a wall of photographs taken with many illustrious figures, including one with Castro.

In 1961, more than 1,000 Cuban exiles were taken prisoner after they attempted to invade their homeland with U.S. help. The next year, the administration of President John F. Kennedy asked Mr. Prettyman to arrange the release of the prisoners in exchange for more than $50 million in food and medical supplies.

During negotiations with Castro, Mr. Prettyman asked to see novelist Ernest Hemingway’s former home in Havana. Castro gave him a private tour.

Afterward, Castro agreed to allow many of the prisoners’ family members to leave as well. Mr. Prettyman joined many of them on their flight out of Cuba.

“As soon as those wheels were up,” he told The Washington Post in 2000, “they went berserk. Yelling, crying, singing. It was very, very emotional. Best Christmas Eve I ever had.”