A man convicted of killing off-duty Chicago Police Officer Michael Bailey in a botched car-jacking attempt nearly a decade ago was sentenced Thursday to life in prison.

Before handing down the sentence for Antwon Carter, Cook County Judge Stanley Sacks pointed to multiple carjackings Carter committed in the weeks before and after he shot Bailey, and to the fact Carter was caught twice with metal shanks inside the Cook County Jail while awaiting trial. The judge also tacked on an additional 35-year sentence for one of those carjackings.

Carter, 32, shook his head and gave a bemused frown as Sacks announced the life sentence. As the judge outlined the reasons for the 35-year sentence, Carter yawned. Before Carter was led from the courtroom, Sacks offered a bon mot to the defendant.

“Mr. Carter, you have your whole life ahead of you,” the judge said. “You’re going to be locked up the entire time.”

Bailey, 62, and just weeks from retirement, had just finished a shift on former Mayor Richard J. Daley’s security detail on a July morning in 2010. As Bailey was wiping down his brand-new Buick Regal in front of his Park Manor home, Carter spotted the gray-haired veteran officer — perhaps missing the police uniform Bailey wore under his tan baseball jersey— and shot Bailey three times. Bailey, who had bought the Buick as an early retirement gift to himself, managed to return fire.

While Sacks said he felt “no compassion” for Carter, Bailey’s wife and daughters told reporters they had forgiven the gunman during the nine years it took for the case to go to trial. Bailey’s wife, Pamela Bailey Wilson, said her late husband might have become a mentor to a troubled young man like Carter.

“He’s a young man, and his life...it’s over. I don’t have any malice or hate in my heart,” she said. “I have children the same age as him....Somewhere along the line, we lost that boy. The system lost him.”

Bailey’s daughter Jada Murry was sworn in as a CPD officer after her father’s death.

“My father died at the hand of doing what he did his whole life, which is serving and protecting,” she said. “I just think it’s a testament to how, even as police officers, even as police officers, we’re a part of the communities that we serve, which means we are not exempt to the crimes that the community faces.”

The case against Carter hinged largely on statements he made, bragging about the killing, to friends, as well as a jail inmate who cut his hair and another inmate he encountered while in a lockup at a branch courthouse.

Sacks said that the attempted theft of Bailey’s car fit a pattern of other carjackings Carter committed. The judge also noted that Carter told police he was a “stickup boy” who preyed on easy targets — in one theft, his victim was a woman leaving a hospital with a cast on her leg.

“When you sit up here as long as I’ve been sitting up here....I’m never usually at a loss for words,” Sacks said. “What can I say about Antwon Carter at this point, other than he’s a dangerous person.”

Carter opted not to make a statement before he was sentenced.

Bailey was one of six CPD officers killed in 2010, one of the deadliest years on record for the department in recent decades.