BOSTON — A Massachusetts man was sentenced Wednesday to life in prison in the killing of a 2-year-old girl who became known as Baby Doe after her remains washed up on the shore of a Boston Harbor island.

Michael McCarthy, 37, will be eligible for parole after serving 20 years under the sentence imposed by Judge Janet Sanders.

McCarthy was convicted Monday of second-degree murder in the 2015 killing of Bella Bond, the daughter of his girlfriend at the time. A computer-generated image of Bella was shared by millions on social media as authorities scrambled to identify her.

Assistant District Attorney David Deakin asked the judge to set McCarthy's parole eligibility at 25 years — 10 years more than the minimum. McCarthy's lawyer called that recommendation "vindictive" and asked Sanders to make him eligible for parole after 15 years. The judge came out in the middle of the two recommendations at 20 years.

The girl's mother, Rachelle Bond, who also was charged in the case, was the prosecution's star witness. She told the jury she saw McCarthy kill her daughter one night after the girl didn't want to go to bed.

McCarthy's lawyer, Jonathan Shapiro, insisted that Bond was the real killer and cast a "web of lies" to blame McCarthy.

"There was no justice for Mr. McCarthy here," Shapiro said.

Defendant Michael P. McCarthy looks at his attorney Jonathan Shapiro after a guilty of second degree murder against him at Suffolk Superior Court on Monday, June 26, 2017. Matt West / AP

Bond pleaded guilty to being an accessory after the fact for helping McCarthy dispose of her daughter's body. Under a plea deal with prosecutors, she is expected to serve less than two years in jail. The agreement calls for her to be released after her sentencing July 12.

Bella Bond's father, Joseph Amoroso, gave a victim impact statement before McCarthy was sentenced, describing Bella as "a happy and innocent child full of life."

"I was robbed of my chance to be a father to Bella," he said.

Testimony during the trial showed the girl's short life was marked by turmoil. Both McCarthy and Bond were heroin addicts. A friend testified that he saw McCarthy discipline the girl by putting her in a locked closet.