BOSTON — A man was convicted Monday of second-degree murder in the death of a 2-year-old girl who became known as Baby Doe after her remains washed up on the shores of a Boston Harbor island.

Michael McCarthy was charged in the 2015 killing of Bella Bond, his girlfriend's daughter. A computer-generated image of the girl was shared by millions on social media after she was dubbed Baby Doe by authorities trying to determine her identity.

The widely shared image showed a chubby-cheeked, brown-eyed girl. Her body was found inside a trash bag on Deer Island in Winthrop in June 2015 by a woman walking a dog.

Michael McCarthy watches as jury selection begins for his murder trial in Suffolk Superior Court in Boston on May 22, 2017. Pat Greenhouse / The Boston Globe via AP file

The jury had been deliberating since June 20.

Prosecutors had charged McCarthy with first-degree murder, but the judge said jurors could also consider two lesser charges — second-degree murder and involuntary manslaughter. Under a second-degree murder conviction, a person is eligible for parole after serving 15 years in prison.

The judge recessed after the verdict was read to see if there were any objections to McCarthy also being sentenced Monday.

Bella's mother, Rachelle Bond, and McCarthy were arrested in September 2015 after Bond told a friend McCarthy had killed her daughter.

Bond pleaded guilty to being an accessory after the fact for helping McCarthy dispose of the girl's body. Under a plea deal with prosecutors, Bond is expected to be released after McCarthy's trial, serving less than two years in jail.

McCarthy's lawyer said Bond was the real killer. He called her a "monster" who made up a "web of lies" to put the blame on McCarthy.

Mike Rapaglia posts a flier looking to help identify Baby Doe in Winthrop, Massachusetts in August 2015. Craig F. Walker / Boston Globe via Getty Images file

The trial included testimony about the girl's short and tragic life. Both Bond and McCarthy were heroin addicts. A friend testified that McCarthy would lock the girl in a closet to discipline her. He said McCarthy had been obsessed with the occult for years.

Bond testified that on the night Bella died, she walked into the girl's bedroom and saw McCarthy leaning over her and punching her. She said she saw McCarthy punch her in the abdomen so hard she bounced off the mattress.

"He said it was her time to die, she was a demon," Bond said.

McCarthy's lawyer aggressively cross-examined Bond about why she didn't call police or report her daughter's death to anyone. She claimed McCarthy threatened to kill her.

The defense also said prosecutors "made a deal with the devil" in offering Bond time-served in exchange for her testimony against McCarthy.