From his seat on the bench, Judge Kevin Thomas Duffy listened patiently to the man he would soon put in prison for the rest of his life.

The man, Ramzi Ahmed Yousef, was the mastermind of the 1993 World Trade Center bombing, and he was not going away quietly. He said he was proud to be a terrorist, and lashed out at the United States and Israel.

When it was time for Judge Duffy to respond, he did so not by citing the law, but another authority: the Quran. It was a somewhat startling moment that reflected how the judge, who retired on Sept. 30, drew upon a broad range of knowledge during his nearly 44 years on the federal bench.

Judge Duffy cited several verses from the Quran, including one that offered tolerance for nonbelievers. “Your God is not Allah,” he told Mr. Yousef. “You worship death and destruction.”