Damon Keith, a grandson of slaves and figure in the US civil rights movement who as a federal judge was sued by Richard Nixon over a ruling against warrantless wiretaps, has died. He was 96.

Keith died on Sunday in Detroit, the city where the prominent lawyer was appointed in 1967 to the US district court, according to the Swanson Funeral Home.

He served more than 50 years in the federal courts, and before his death still heard cases about four times a year at the 6th US circuit court of appeals in Cincinnati.

A revered figure in Detroit for years, Keith captured the nation’s attention with the wiretapping case against Nixon and attorney general John Mitchell in 1971. Keith said they could not engage in the warrantless wiretapping of three people suspected of conspiring to destroy government property. The decision was affirmed by the appellate court, and the Nixon administration appealed and sued Keith personally.

Damon Keith introduces Bill Clinton at the funeral of anti-segregation campaigner Rosa Parks in 2005. Photograph: Paul Warner/WireImage

The case went all the way to the Supreme Court, where the judge prevailed in what became known as “the Keith case”.

Keith revisited the civil liberties theme roughly 30 years later in an opinion that said president George W Bush could not conduct secret deportation hearings of terrorism suspects. Keith’s opinion contained the line: “Democracies die behind closed doors.”

A similar phrase, “Democracy dies in darkness”, is now the slogan of The Washington Post, which has credited Keith.

“During his more than 50 years on the federal bench, he handed down rulings that have safeguarded some of our most important and cherished civil liberties, stopping illegal government wiretaps and secret deportation hearings, as well as ending racial segregation in Pontiac (Michigan) schools,” Detroit mayor Mike Duggan said in a statement.

Praveen Madhiraju, Keith’s former law clerk, worked with him on the 2002 opinion against Bush. Keith had credited Madhiraju with coining the “Democracies die behind closed doors”, line, but the attorney now based in Washington DC said Keith deserved far more credit.

“I came up with the words, but Judge Keith was clearly the inspiration behind the whole thing,” Madhiraju told Associated Press in December 2017. “There’s no way if I’d worked with any other judge in the country I would have thought of that phrase.”

Madhiraju said Keith would periodically pop in the clerk’s office to offer suggestions, such as instructing him to review the Pentagon Papers on US policy toward Vietnam and the words of the late senator, William Fulbright, who said: “In a democracy, dissent is an act of faith.”

Keith told AP in an October 2017 interview that the phrase “equal justice under law”, which is etched onto the US supreme court building in Washington, inspired him and always summoned the lessons Thurgood Marshall taught him as one of his professors at Howard University. Marshall became the first black supreme court justice in October 1967 the same month Keith received his federal appointment.

He recalled Marshall saying: “When you leave Howard, I want you to go out and practice law and see what you can do to enforce those four words.”