John C. “Jack” Keeney, a federal prosecutor who retired last year after 59 years at the Justice Department, where he bolstered the organized crime division and helped negotiate a treaty that allowed U.S. investigators to access Swiss bank accounts, died Nov. 19 at his home in Kensington. He was 89.

He had heart disease, according to the Maryland Office of the Chief Medical Examiner.

When Mr. Keeney retired, The Washington Post reported that he was the longest-serving federal prosecutor in U.S. history. He served as deputy chief of the organized crime and racketeering section, chief of the fraud section and, for nearly 40 years, deputy assistant attorney general in the criminal division.

Mr. Keeney was revered by colleagues for what they described as his unerring judgment. Prosecutors from across the department called on him for advice. Mr. Keeney often handwrote his responses on antiquated buck slips.

Early in his career, he distinguished himself as a top prosecutor working under Attorney General Robert F. Kennedy on organized crime cases. Before the passage of the Racketeer Influenced and Corrupt Organizations Act, Mr. Keeney helped the department “go after an entire enterprise and not simply after individuals for discrete crimes,” said Lanny Breuer, the current assistant attorney general for the criminal division.

In the fraud section, which Mr. Keeney led in the early 1970s, he helped negotiate a groundbreaking treaty with Switzerland.

In an interview published in a 1999 U.S. attorneys’ bulletin, he explained that the agreement allowed U.S. investigators to access Swiss bank accounts — which had long been sheltered — by “creating an exception for major criminal investigations.”

The only prosecutions that gave Mr. Keeney pause were among his first. As a young lawyer in the 1950s, he prosecuted alleged Communists under the controversial Smith Act, which outlawed advocating the forceful overthrow of the U.S. government.

“Looking back . . . I’m not so sure that we needed to do it,” he told National Public Radio in 2007, “but that was the prevailing sentiment.”

John Christopher Keeney was born Feb. 19, 1922, in Ashley, Pa.

He served in the Army Air Forces during World War II and early in 1945 was shot down during a bombing mission over Germany. He was held in a Nazi prison camp until the war ended.

Mr. Keeney received a bachelor’s degree from the University of Scranton in 1947, a law degree from the Dickinson School of Law (now part of Penn State’s law school) in 1949, and a master of laws degree from George Washington University in 1953.

A Justice Department building in the District was named after Mr. Keeney in 2000.

His wife, Eugenia Brislin Keeney, died in 1993 after 43 years of marriage.

Survivors include five children, John Keeney Jr. of Bethesda, Terence Keeney of McLean, Jeanmarie Keeney of Kensington, Joan Keeney of Silver Spring and Kathleen Keeney of Catonsville, Md.; and four grandchildren.