A woman who admitted to bludgeoning her mother and grandmother to death and robbing them after they took her into their New Jersey beach home was sentenced Thursday to 42 years in prison.

Heather Barbera, 43, apologized for the brutal killings of her mother, Michelle Gordon, 67, and her 87-year-old grandmother, Elaine Rosen, The Press of Atlantic City reported. She had pleaded guilty to aggravated manslaughter and murder in October.

Prosecutors said Barbera beat the pair with a nightstick and robbed them in their Ventnor City condo in July 2018. She then walked away as they lay dying, they said.

MAN SOUGHT IN BRUTAL NYC BEATING THAT KILLED 92-YEAR-OLD WOMAN

Heather Barbera, with her attorney James Leonard, speaks to  Atlantic County Superior Court Judge Bernard DeLury on Thursday before she was sentenced for the slaying of her mother and grandmother in their Ventnor condo. (Vernon Ogrodnek/The Philadelphia Inquirer via AP, Pool)

Heather Barbera, with her attorney James Leonard, speaks to  Atlantic County Superior Court Judge Bernard DeLury on Thursday before she was sentenced for the slaying of her mother and grandmother in their Ventnor condo. (Vernon Ogrodnek/The Philadelphia Inquirer via AP, Pool)

“This defendant bludgeoned the two victims to death in their own home, then cleaned herself off,” prosecutor Allison Eiselen said, according to the newspaper. “She stole their money and their jewelry and, as they were gasping their final breath, she just walked away.”

Defense attorney James Leonard said Barbera came from a "very toxic and very unhealthy family dynamic on both sides." He said she battled substance abuse, mental health and emotional issues.

In court, Barbera apologized for the slayings.

“I never wanted any of this to happen,” she said.

Heather Barbera enters court for her sentencing for the July 2018 slaying of her mother and grandmother in their Ventnor condo, in Atlantic County Superior Court, in Mays Landing. (Vernon Ogrodnek/The Philadelphia Inquirer via AP, Pool)

Heather Barbera enters court for her sentencing for the July 2018 slaying of her mother and grandmother in their Ventnor condo, in Atlantic County Superior Court, in Mays Landing. (Vernon Ogrodnek/The Philadelphia Inquirer via AP, Pool)

Before imposing his sentence, Atlantic County Superior Court Judge Bernard DeLury Jr. said Barbera had committed “brutal matricide."

CLICK HERE FOR THE FOX NEWS APP

“After her violent attack on these two women, the defendant callously and calmly cleaned herself up, collected the valuable belongings she could find, including a ring from the hand of her dead mother, and then pawned the jewelry,” DeLury said. “She then fled the jurisdiction. The depravity is palpable.”

Under the terms of her plea agreement, Barbera will be eligible for parole after serving 40 years. In addition to prison time, she was ordered to pay $7,000 in restitution.