Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

The little girl known as "Baby Doe" was killed in her bedroom by her mother's boyfriend — a man who was convinced the toddler was possessed by demons, a prosecutor told a Boston courtroom on Monday.

Bella Bond, 2, was found June 25 by a dog-walker in a trash bag on Deer Island in Boston Harbor and was identified last week. Horrifying details about the girl's short life and death were revealed in court Monday morning as her mom, Rachelle Bond, and Bond's boyfriend, Michael McCarthy, were arraigned after their arrest on Friday.

RELATED: Girl Found Dead in Boston Identified, Mother and Boyfriend to Be Charged

McCarthy, 35, is being held without bond on a murder charge. Bond, 40, is being held on $1 million bail after authorities charged her as an accessory after the fact.

Assistant District Attorney David Deakin told a Dorchester District Court judge on Monday that a "lifelong friend" of McCarthy's broke the case open.

The friend told authorities that he had lived with Bond and McCarthy for a week or two just several months before her death, and was "appalled by their treatment" of Bella.

Michael Patrick McCarthy, left, and Rachelle Dee Bond, right, are arraigned in Dorchester District Court, on Monday in Boston. The judge ordered Bond held on $1 million cash bail and McCarthy held without bail. Pat Greenhouse / The Boston Globe via AP

"What troubled him the most was that both of them, particularly Mr. McCarthy, had locked the girl in the closet for 30 minutes to an hour while she screamed to be let out," Deakin said. "Mr. McCarthy told the lifelong friend that she was possessed by demons, and that's why she deserved that treatment."

The treatment escalated into deadly force sometime in late May, Deakin said, when one night, Bella refused to go to bed.

Rachelle Bond posted a photo of her daughter Bella to her Facebook page. via Facebook

"Mr. McCarthy said he was going to go to the back bedroom and calm her down," Deakin said. When Bond went to check on them, he continued, "She found Mr. McCarthy standing over Bella... with his hand near her abdomen."

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Bella wasn't talking. Bond noticed her face was swollen, Deakin said.

"She went to her daughter and picked her up and she told police that she knew at that moment that her daughter was dead."

RELATED: Baby Doe Tipster Said 'She Deserves a Name'

No manner of death has been determined by a medical examiner. Suffocation or asphyxiation, which could have resulted from blunt force to her stomach, wouldn't necessarily leave signs of physical trauma, Deakin said.

McCarthy allegedly told Bond that Bella "was a demon anyway. It was her time to die." He then allegedly threatened to kill Bond if she reported anything to police.

Both Bond and McCarthy have prior criminal records and were involved in drugs, Deakin said. They will return to court on Oct. 20.

The friend who tipped off authorities told them that he texted McCarthy, asking where Bella was after noticing a resemblance between the billboards put up across Boston seeking information about a "Baby Doe."

The friend said McCarthy claimed Bella had been taken away by child services, who twice visited Bella over the course of her lifetime but left her in Bond's custody.

Rachelle Dee Bond is arraigned on charges of acting after the fact in helping to dispose of the body of her daughter in Dorchester District Court, on Monday in Boston. Pat Greenhouse / The Boston Globe via AP

Bond came to court wearing a gray sweatshirt and a hood over her head. McCarthy wore his long hair down by his shoulders. Bond looked down and appeared to wipe away tears as Deakin spoke.

After killing Bella, according to Deakin, McCarthy stuffed her body in a trash bag and kept it in a refrigerator for days before dumping her in the Boston Harbor.

When her body was found, she was dressed in white pants with black polka dots and a zebra-print blanket was left in the trash bag. The woman who discovered Bella's body noticed the bag after her dog began pawing at it.

Authorities also found books on "demons and demonology" in the apartment the couple shared, Deakin said. They were allegedly high on heroin for several days after Bella's death.

As Deakin described Bella's body being hauled to the Boston Harbor, Megan Fewtrell, a former friend of Bond's who told NBC News that she was Bella's godmother, yelled, "You rot in hell!" and was escorted out.

Fewtrell told NBC News she didn't understand how Bond could let the girl be harmed.

"Rachelle, how could you cover that up? How could you help the man who killed Bella?" she asked. "You could have left Bella with me before anything happened."

"I do not want people to think that Bella was not loved," she added. "Because she was. Very much so."

The mystery of Bella's identity drew worldwide attention and thousands of tips.

Rachelle Bond and her daughter Bella in a photo posted on her Facebook page. via Facebook

Bella's father, Joseph Amoroso, told local media in Boston that Bond told him her boyfriend killed the girl.

Amoroso, 32, said he had been living in Florida for the past couple of years and had never met his daughter. He also wiped tears from his eyes as he sat and listened in court on Monday.

Bella had pierced ears and appeared well-nourished at the time of her death. She would have turned 3 last month.

Over the weekend, mourners — many of whom did not know Bella — stopped by Deer Island to leave candles, balloons and stuffed animals in an impromptu memorial for her, reported NBC affiliate WHDH.

"I also have a little girl who is the same age as Bella," Kim Marco, of Revere, Massachusetts, told the station. "I couldn't imagine some of the things that these people did to her."