At the time, in 2005, Mr. Scarpa was eager to reduce his sentence of 482 months (40 years). The Colombo captain, a gangster whose father was a violent enforcer for the crime family, had been convicted in Federal District Court in Brooklyn of a racketeering case that included charges of conspiracy to commit murder, tax evasion and illegal gambling. Mr. Scarpa’s prison yard conversations with Mr. Nichols led to a cache of hidden explosives, an embarrassment for the Federal Bureau of Investigation, and a chain of litigation that resulted in a decision on Monday by a federal judge in Brooklyn. The judge, Edward R. Korman of United States District Court, shaved 10 years off Mr. Scarpa’s sentence in a decision that castigated both the F.B.I. and the United States attorney’s office in Brooklyn for its “implausible, contradictory, and factually unsupported reasons” for opposing a lighter sentence for Mr. Scarpa.

Mr. Scarpa did not have a great track record as an informer. Years earlier, he had provided information on a jailmate Ramzi Yousef, the chief organizer of the 1993 World Trade Center bomber, but the government said nothing came of the disclosures. At Mr. Scarpa’s sentencing in 1999 in the racketeering case, a prosecutor said the tip about Mr. Yousef was “a scam” that resulted in “wild goose chases.” A judge sentenced Mr. Scarpa to 40 years, on top of the 20 he was serving for another racketeering case.

In 2005, Mr. Scarpa said, he told prison officials he knew that Mr. Nichols had stashed explosives in his old house. Nothing happened. Mr. Scarpa told agents from the F.B.I. Nothing happened.

It was only after private investigators contacted by Mr. Scarpa sent multiple letters to congressional representatives and to the National Security Council alerting them to the information that the F.B.I. acted on the tip, according to court documents. Agents had already searched Mr. Nichols’s house multiple times. This time, they found the explosives in a crawl space, right where Mr. Scarpa’s tip indicated they would be. News coverage called it a “new embarrassment to an F.B.I. already burned by missteps in this case,” and a congressional inquiry ensued.

Mr. Scarpa got the information through a “sting,” as he put it, according to notes from, and interviews of, Mr. Scarpa summarized by one of the private investigators. Mr. Scarpa said he would pay Mr. Nichols for revealing the location of the explosives, and pass that on to a private investigator, who would examine the material for fingerprints and DNA. Mr. Nichols thought the evidence would link a man who testified against him, Roger Moore, to the bombing.

“I have kept my word — TLN” reads one letter Mr. Scarpa said Mr. Nichols wrote to him. The letter, dated March 2005, describes a crawl space in the basement of Mr. Nichols’s house, with two piles of rocks. “Under the south pile is my ammo can. Under the north are the 2 cardboard boxes wrapped in plastic. Simply remove the rocks,” it says.

There were several other letters that Mr. Scarpa said were from Mr. Nichols, discussing, among other things, the pronunciation of Mr. Nichols’s first and second wives’ names; how to use acupressure to handle pain; the mislabeling of “non-dairy creamer” in the prison; his view that “God is a vengeful God”; and a complaint of “a big gap of communications between you and I.”

In March 2005, Mr. Scarpa met with one F.B.I. agent, then two. An agent said that he “can easily see that all these notes are from one person (me),” according to the investigator’s summary of Mr. Scarpa’s comments. “He said it’s some kind of scam.”

Mr. Scarpa turned to private investigators. Throughout March 2005, those investigators contacted congressional representatives and staff members with the information. By the end of March, one congressman pressured the F.B.I. to investigate Mr. Scarpa’s tip, according to Judge Korman’s decision.

On April 2, F.B.I. agents searched Mr. Nichols’s house. The Associated Press reported that they had searched the home several times before and had missed the explosives.

Mr. Scarpa’s campaign for a lower sentence began then, and continued until Monday.

Usually, prosecutors recommend reducing the sentence of a defendant who has helped the government. However, Judge Korman wrote that is subject to judicial review, which he did with some vigor in his opinion.

Prosecutors had opposed a reduction of Mr. Scarpa’s sentence, arguing that he had obstructed justice in the past by lying on the stand at his trial, “through his alleged ‘sham’ cooperation in the Yousef case,” and by embellishing the information about Mr. Nichols, Judge Korman wrote. These claims, he wrote, were “vague and not supported by the facts.”

The judge asked an F.B.I. agent who interviewed Mr. Scarpa in March 2005 to provide an affidavit about what happened. Some of what the agent, who was not named, wrote is “flatly incorrect,” the judge found. For instance, the agent said Mr. Scarpa’s tip had not provided the basis for an F.B.I. warrant, yet the search had been a consent search and there had been no warrant.

Judge Korman also criticized an assistant United States attorney working on the case, Patricia E. Notopoulos. This is, he wrote, “an apparent case of the AUSA relying on faulty and inaccurate information provided by the F.B.I. to deny Scarpa sentencing relief based on his substantial assistance.”

“It is difficult to ignore the fact that the information Scarpa provided embarrassed the F.B.I.,” he wrote.

Nellin McIntosh, a spokeswoman for the United States attorney’s office, declined to comment.

Judge Korman’s reduction of Mr. Scarpa’s sentence would push his release date to 2025, when he would be 74.

It was a hollow victory for Mr. Scarpa, who has cancer and other ailments. “It is more likely than not,” Judge Korman wrote, that the conditions “will take his life within five years.”

A version of this article appears in print on , on Page A19 of the New York edition with the headline: A Mafia Captain Turned Informer Has 10 Years Cut From His Prison Term. Order Reprints | Today’s Paper | Subscribe

Sign up for the New York Today Newsletter

Each morning, get the latest on New York businesses, arts, sports, dining, style and more.