NEW YORK — Shortly after his conviction for overseeing a quarter-century's worth of murder and other crimes as head of the Bonanno organized crime family, Joseph Massino did the unthinkable for an old-school mobster: He told prosecutors he was ready to break the Mafia's code of silence.

An overweight, red-faced Massino shuffled into a Brooklyn courtroom Wednesday to hear prosecutors praise his work as the highest-ranking member of the city's five Italian organized crime families to ever become a government cooperator. At the end of a half-hour hearing, a judge gave him his reward: a reduction of a life sentence to time served, about 10 ½ years.

Massino, 70, was ordered to spend another two months behind bars before being released under FBI supervision for the rest of his life. His only words Wednesday were an apology of sorts.

"I pray every night for all of the people I hurt, especially the victims' families," he said.

It was an extraordinary reprieve for the former boss of a crime family known for its intense insularity and for inspiring the film "Donnie Brasco."

His decision to betray the Bonannos sent the message that "omerta is dead and the Mafia is on the run," Massino's attorney, Edward McDonald said in court. He also described his client as "a very sick and tired old man" who was incapable of doing more harm.

In court papers urging U.S. District Judge Nicholas Garaufis to resentence Massino, prosecutors credited him with providing information that was used in 10 prosecutions of mob figures and that led investigators to vacant lot where the remains of two men killed in 1981.

"The court is under no illusions about the motives for Mr. Massino's cooperation," Garaufis said before withdrawing the life term. "In helping the government, has also has helped himself, and his cooperation in no way justifies his life of crime. Nevertheless, his prosecution has brought great risk upon himself and his family and great benefits to the government's efforts to dismantle organized crime."

Massino was convicted at a 2004 trial on charges he had a hand in multiple gangland murders, including the shotgun slayings of three rival gangsters and the execution of another mobster who vouched for FBI undercover Brasco in the 1990s. Brasco's story became a movie starring Johnny Depp and Al Pacino.

After offering to cooperate, Massino secretly recorded his jailhouse conversations with the then-acting boss of the Bonannos, Vincent "Vinny Gorgeous" Basciano. He then testified at a 2011 trial that resulted in Basciano's conviction.

Basciano "told me that he killed him," Massino said in recounting a conversation about the 2004 slaying charged in the case. "He said (the victim) was a scumbag, a rat, a troublemaker, a bad kid."

By cooperating, he explained to the jury, he was violating a sacred oath he took during a 1977 induction ceremony to protect the secret society. It was understood, he said, that "once a bullet leaves that gun, you never talk about it."

He testified that when he took control of the family he gave strict orders to never utter his name — a precaution against FBI surveillance. Instead, his soldiers touched their ears to refer to him, earning him the nickname "The Ear."

Asked about his duties as boss, he replied, "Murder. ... Making captains. Breaking captains" — lingo for promoting and demoting capos. He said he also had to assess talent.

"It takes all kinds of meat to make a good sauce," said Massino, the one-time proprietor of a Queens restaurant called CasaBlanca. "Some people, they kill. Some people, they earn, they can't kill."