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.

The jury had been deliberating since June 20.

Suffolk District Attorney Daniel Conley speaks to the media on developments in the case of Bella Bond, who became known as Baby Doe, on Sept. 18, 2015, in Boston.AP

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.

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.

Rachelle Bond in 2015AP

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.