MIAMI, Florida (CNN) -- A judge sentenced a rogue FBI agent to 40 years in prison on Thursday for the 1982 mob-related killing of a witness who was about to testify against Boston mob members, court officials said.

Former FBI agent John Connolly "crossed over to the dark side," a judge said.

Disgraced ex-FBI agent John Connolly Jr. "crossed over to the dark side," said Miami-Dade Circuit Court Judge Stanford Blake. The sentence will run consecutively to a 10-year racketeering sentence.

Connolly, 68, was convicted in November of second-degree murder in the death of businessman John Callahan, an executive with World Jai-Alai. Callahan's bullet-riddled body was found in the trunk of a Cadillac parked at Miami International Airport.

Connolly's fall from celebrated mob-buster to paid gangland flunky captivated a South Florida courtroom for weeks. In testimony at his sentencing hearing last month, he denied having any role in Callahan's death.

"It's heartbreaking to hear what happened to your father and to your husband," he told members of Callahan's family. "My heart is broken when I hear what you say."

He explained, in the face of vigorous cross-examination, that rubbing elbows with killers and gangsters and winning their confidence was part of his job. His attorney argued that Connolly did what the FBI wanted him to do, and now was being held responsible.

Connolly did not testify at his trial.

Prosecutors had asked that Connolly be given a life sentence, saying the 30-year minimum was not enough because Connolly abused his badge.

In a Boston Globe interview published last month, however, Connolly vigorously denied being a corrupt agent.

"I did not commit these crimes I was charged with," Connolly told the newspaper. "I never sold my badge. I never took anybody's money. I never caused anybody to be hurt, at least not knowingly, and I never would."

During his two-month trial, jurors heard that Connolly told his mob connections that Callahan, 45, was a potential witness against them, setting him up for the gangland-style slaying.

According to testimony, Connolly was absorbed by the very gangsters he was supposed to be targeting -- members of South Boston's notorious Winter Hill gang. His story was said to be the inspiration for the character played by Matt Damon in the 2006 Martin Scorsese movie, "The Departed."

Connolly's tale was closely followed in New England, where he grew up in Boston's "Southie" neighborhood, the same area long dominated by the Winter Hill gang and its notorious leader, James "Whitey" Bulger. Sought in 19 slayings, Bulger is the FBI's second most-wanted fugitive.

During the first two decades of his FBI career, Connolly won kudos in the bureau's Boston office, cultivating informants against New England mobsters. Prosecutors said Connolly was corrupted by his two highest-ranking snitches: Bulger and Stephen "The Rifleman" Flemmi.

Connolly retired from the FBI in 1990 and later was indicted on federal racketeering and other charges stemming from his long relationship with Bulger and Flemmi. He was convicted of racketeering in 2002 and was serving a 10-year federal prison sentence when he was indicted in 2005 in the Callahan slaying.

During testimony, jurors heard that Connolly was on the mob payroll, collecting $235,000 from Bulger and Flemmi while shielding his mob pals from prosecution and leaking the identities of informants.

The prosecution's star witnesses at the Miami trial were Flemmi, who is now in prison, and mob hit man John Martorano, who has admitted to 20 murders, served 12 years in prison and is now free.

Callahan, who often socialized with gangsters, had asked the gang to execute Oklahoma businessman Roger Wheeler over a business dispute, according to testimony. Martorano killed Wheeler in 1981 on a golf course, shooting him once between the eyes, prosecutors said.

After Connolly told Bulger and Flemmi that Callahan was going to implicate them in the slaying, Martorano was sent to do away with Callahan, prosecutors said.

But one star witness did not testify -- the former FBI agent who inspired the 1997 film "Donnie Brasco." He refused to take the stand after the judge denied his request to testify anonymously.

All About John J. Connolly Jr. • Organized Crime