Updated

A Massachusetts man has been convicted of second-degree murder Monday in the 2015 death of 2-year-old “Baby Doe,” after her remains washed up on the shores of a Boston Harbor island, sparking a month-long investigation to identify her.

Michael P. McCarthy, 37, was charged in the killing of Bella Bond, the daughter of his former girlfriend Rachelle Bond. A computer-generated image of the girl was shared by millions on social media after she was dubbed Baby Doe by investigators who were trying to identify her.

MASSACHUSETTS MAN ACCUSED OF KILLING ‘BABY DOE’ WON’T TESTIFY

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

The Suffolk County Superior Court jury had been deliberating since June 20.

rachelle bond

Rachelle Bond, Bella's mother and McCarthy's former girlfriend, testified that she helped dispose of the little girl's body. (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, Boston 25 News reported. Under a second-degree murder conviction, a person is eligible for parole after serving 15 years in prison.

McCarthy will be sentenced Wednesday.

Bond and McCarthy were arrested in Sept. 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.    

MASSACHUSETTS STORE CLERK FIGHTS OFF ARMED ROBBER

McCarthy’s lawyer claimed Bond was the real killer. He called her a “monster” who made up a “web of lies” to put the blame on McCarthy.

Both Bond and McCarthy were heroin addicts. A friend testified that McCarthy would lock the toddler in a closet to discipline her. Prosecutors alleged that McCarthy murdered Bella because he thought she was possessed by evil spirits. He had allegedly been obsessed with the occult for years.

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

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.

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.

Click for more from Boston 25 News.

The Associated Press contributed to this report.