AUGUSTA — Andrew T. Balcer was sentenced Tuesday to serve 40 years in prison for murdering both parents in the family’s Winthrop home during the early morning hours of Halloween 2016.

The hearing, before Justice Daniel Billings, took place in front of about 75 people, including the victims’ relatives and friends and a bevy of news cameras.

Balcer, who turned 20 on Monday, now identifies as a woman named Andrea. She was about a month shy of turning 18 when the killings took place. Balcer took a hunting knife and stabbed her mother nine times in the back about 1 a.m. on Oct. 31, 2016.

Balcer, who has been in custody since that morning, wore a two-piece green jail uniform and with a lock of longer dark hair covering much of the left side of her face. Her attorney, Walter McKee, asked for Balcer’s handcuffs to be removed so she could take notes, and the judge ordered it.

Alice Balcer’s cries woke Antonio “Tony” Balcer, who ran into the bedroom and became the next victim, leaving a trail of blood from the bedroom to the kitchen, where he was found face up on the floor.

Next, Andrea Balcer stabbed the family’s Chihuahua to quiet the dog’s barking, while sparing an older brother who fled the bloody scene.

After a series of hearings in juvenile court, the state succeeded in having Balcer, who was 17 at the time, prosecuted as an adult.

She pleaded guilty Sept. 19 at the Capital Judicial Center under an agreement with the state that caps the maximum sentence at 55 years in prison. The state had been asking for Balcer to serve all that time. The defense was suggesting the 25-year minimum sentence would be appropriate for someone who was a juvenile when the crimes were committed.

“I made a terrible mistake, one that cost the lives of the two people that gave me life and raised me,” Andrea Balcer said.

“I am only here to ask for one thing: That is the forgiveness of my family,” she added.

Balcer said she knows she’s hurt those who loved her.

“I am truly sorry for what I have done; I have killed my parents,” she said. “I will always remember what I have done.”

In outlining his reason for the sentence, Billings said, “The crime could not be more horrific. The degree of violence in this case could not be more severe.”

He also noted that it is a crime of domestic violence.

Billings said he noted that in the 911 call, “The defendant seemed thrilled by her actions on the night in question.” The judge said he attributed some of that to her immaturity and lack of emotional development.

Andrea Balcer calls 911 after stabbing her parents on Oct. 31, 2016. This recording contains strong language that is not appropriate for all people.

Balcer hung her head and looked down at the defense table Tuesday as the 911 tape played over the courtroom speakers. She tells the dispatcher she killed her parents but doesn’t know why.

Balcer says the same thing when she’s interviewed by Maine State Police Detective Abbe Chabot, telling her, “I can remember most of what I did, but I can’t remember why I did it.”

In a jailhouse interview days before that plea, Balcer alleged she was molested for years by her mother and suffered physical and mental abuse by her father, all inside the home at 10 Pine Knoll Road.

“Nobody really thought there was anything going on,” Balcer said. “No one would think that two respectable people would ever do or have done such things. I just want people to know that even when something seems perfect, there might be something much more worse going on underneath.”

Christopher Balcer, the older brother, vehemently denied those abuse allegations and has said he had no idea why the slayings were committed.

Andrea Balcer said she knew about her gender identity when she was younger and told her parents about it when she was 3 or 4 years old.

“I wanted to grow up and be a woman,” she said. “They kind of sat me down and told me and kind of physically forced into me that that was something that was not acceptable.”

She was raised as male, and suggested that a gender identity crisis — along with a fear that the sexual molestation would resume after a hiatus of a year or so — caused her to snap that night.

Balcer also offered to kill her older brother Christopher, but instead spared him when he said he did not want to die. Christopher Balcer fled to a neighbor’s house. He now lives in Ohio and has rejected Andrea Balcer’s overtures, including a letter in which she apologizes for killing their parents.

Christopher Balcer, who attended Tuesday’s sentencing at the Capital Judicial Center, responded with his own letter, saying the crimes are unforgivable and he wants no contact.

“I still hear our dearest mother’s screams, every night as I fall asleep. Every morning as I awaken, they echo in my head. Her screams as she was stabbed by the son she doted on so much, the son she only wanted the world for, and would accept nothing less,” Christopher Balcer said. “I remember the foul things you accused her of, and the looks of horror upon the family’s faces as they heard about them. You are an inhuman creature and the fact that you continue to pretend otherwise sickens me.”

In court, Andrea Balcer clutched her sides and shook as she sobbed quietly as Christopher urged the judge to impose the full sentence for “a remorseless murderer.”