TUPELO, Miss. (AP) — A Mississippi man has been sentenced to 45 years in prison after he pleaded guilty Sunday to the 2019 death of his girlfriend’s 6-year-old son.

Joshua Lewis Oakley, 31, of Tupelo, was going to face the possibility of the death penalty in a capital murder trial that was set to begin Monday. The Northeast Mississippi Daily Journal reported Oakley agreed to plead guilty to the lesser charges of second-degree murder and child neglect after a witness came forward Saturday with additional information against him in the death of Camden Blair.

Lee County Circuit Court Judge Kelly Mims judge sentenced Oakley to the maximum of 40 years for the child’s death and another five years for not seeking immediate medical treatment. The sentences will be served consecutively.

“I don’t known what happened that night, but I know no 6-year-old deserves what this child endured,” Mims said.

Oakley was babysitting Camden on Nov. 12, 2019. According to court testimony, the boy suffered severe burns in his bathwater. Oakley waited about eight hours before taking him to North Mississippi Medical Center. Camden was taken to Le Bonheur Children’s Hospital in Memphis, Tennessee, and later sent to the Arkansas Children’s Hospital in Little Rock, which has a burn unit.

Oakley had remained in the Lee County jail without bond since he was arrested Nov. 13, 2019, and charged with child abuse. When the first grader died 17 days later, the charge was upgraded to capital murder.

In court Sunday, Oakley said: “I want to apologize to the victim’s family, and to my family as well, for putting them in the situation we are today.”

A coroner said the preliminary autopsy identified signs of trauma consistent with Camden being beaten.

“The child had all the injuries associated with the burns. There were also pre-existing and healing rib fractures,” Lee County District Attorney Weddle said. “We had no way to connect Oakley to those injuries until the witness came forward.”

Assistant District Attorney David Daniels said Camden’s family was informed of the plea deal and agreed to the recommendation. Weddle said prosecutors wanted to keep Oakley in prison for the rest of his life, “and 45 years day-for-day is effectively a life sentence in this case.”