BOSTON -- A former high-ranking FBI agent was sentenced Friday to two years of probation for lying on the witness stand during Boston gangster James "Whitey" Bulger's racketeering trial.

Robert Fitzpatrick, 76, was the assistant special agent in charge of the Boston FBI office from 1981 to 1986, during a time when Bulger led a violent gang responsible for more than a dozen murders and simultaneously worked as an FBI criminal informant.

During Bulger's 2013 trial, Fitzpatrick testified that he tried to end the FBI's corrupt relationship with Bulger, who was protected from prosecution by agents who saw him as a valuable informant on the New England Mob.

Get Breaking News Delivered to Your Inbox

Prosecutors said Fitzpatrick lied about trying to close Bulger as an informant and also overstated his professional accomplishments, in part to boost sales of a book he co-authored, "Betrayal: Whitey Bulger and the FBI Agent Who Fought to Bring Him Down."

One of his false claims was that he was the first law enforcement officer to recover the gun used to assassinate Martin Luther King Jr. in 1968.

Fitzpatrick's sentence, which spared him any prison time, was recommended by prosecutors and his defense lawyer under a binding plea agreement. Fitzpatrick pleaded guilty to six counts each of perjury and obstruction of justice.

In recommending probation, both sides cited Fitzpatrick's age and multiple health problems, including cancer, kidney disease and diabetes. He was also ordered to pay a $12,500 fine.

U.S. District Judge F. Dennis Saylor IV accepted the sentencing recommendation, but noted that Fitzpatrick could have faced prison time for what he called "a very serious offense."

"This is not a happy moment," Saylor said. "Mr. Fitzpatrick has earned his punishment. He has perhaps earned something significantly more."

Fitzpatrick left the courthouse quickly after the hearing, saying he just wants to move on with his life. His lawyer, Robert Goldstein, said he doesn't view the sentence as a light punishment, despite the fact that Fitzpatrick won't have to go to prison.

"It's an appropriate, fair sentence," Goldstein said. "Mr. Fitzpatrick has been excoriated in the press."

Bulger, now 86, is serving a life sentence after being convicted of a litany of crimes during his racketeering trial, including participating in 11 murders.

Janet Uhlar, one of the jurors who convicted Bulger, attended Fitzpatrick's sentencing hearing and said afterward that she believes he was unfairly targeted by prosecutors.

"I think he was railroaded," she said.