Edward "Jake" Wagner pleaded guilty on Thursday to aggravated murder and has agreed to testify against his mother, father, and older brother over the 2016 killings of seven members of the Rhoden family and Hannah Gilley.

Prosecutors alleged that the 28-year-old suspect and his family committed the crimes so they could have full custody of a child Jake Wagner shared with Hanna Rhoden. The girl is now seven years old, according to a Law and Crime report.

Jake Wagner sought full custody of her daughter days after the murders took place. He was granted full custody in June 2016.

Jake's father, George "Billy" Wagner; his mother, Angela Wagner; and his older brother, George Wagner IV, were said to have committed the crimes with him.

"At this point, it is noted your honor, the defendant has confessed and apologized for committing these offenses with his family members and admits to personally causing the death of five of the eight victims," the prosecuting attorney said as reported by WDTN.

As part of his guilty plea deal, Jake Wagner will avoid the death penalty and serve eight consecutive life sentences without the possibility of parole. This would also mean that he will have to testify against his family members.

READ NEXT: Texas Teacher Sexually Abused Her Former Student for Years: Police

Killings of the Rhoden and Gilley Family Members

The murders happened from Apr. 21 to 22, 2016 at four locations at Pike County in Ohio. Authorities found eight people shot separately inside their homes. 

The investigation went on for nearly two years before police arrested Jake and several members of his family. Then Attorney General Mike DeWine led the investigation and said the suspects spent months planning the killings.

DeWine noted that the suspects studied the habits and routines of the Rhoden family, including where certain family members slept and the layout of their homes.

Victims of the Rhoden family were between 16 and 44 years old. Hanna Rhoden, the ex-girlfriend of Jake, was among the victims.

The other victims were Christopher Rhoden Sr., 40; Dana Rhoden, 37; Clarence "Frankie" Rhoden, 20; Christopher Rhoden Jr., 16; Kenneth Rhoden, 44; Gary Rhoden, 38; and Hannah Gilley, 20.

Christopher Rhoden Sr. was reported to have been awake at the time of the killing, but he was shot nine times. Frankie Rhoden was found dead with his fiancée Hannah Gilley, Oxygen reported. The couple had a six-month-old baby boy who was found alive.

Frankie Rhoden also had a 3-year-old son who was at the scene when the murders took place, but he was also spared from the killings.

Billy's mother, Fredericka Wagner, and Angela's mother, Rita Newcomb, were also charged with allegedly helping cover up the crimes. Both women pleaded not guilty.

Fredericka earlier said in a report that when she first heard about the murders that morning, she thought it was "ISIS" or a terrorist attack.

Jake Wagner remains in custody at the Franklin Co. Jail in Columbus, Ohio. Aside from the eight counts of aggravated murder, Jake Wagner also agreed to plead guilty to gun specifications, burglary, conspiracy, possession of dangerous ordnance, and tampering with evidence.

He is scheduled to go to trial in late August. 

READ MORE: 17-Year-Old Suspect Arrested for Mass Shooting That Killed 5 People, Including Pregnant Woman

WATCH: New Trial Date Set for Jake Wagner for The Murders of Rhoden, Gilley Family Members - From LOCAL 12