Xzayvion Riley’s mother sobbed when she told a judge Thursday she’ll always be haunted by the fact she didn’t do more when the boy’s father prevented her from checking on their 8-year-old son the night before he died from an infected ruptured bowel in 2012.

“I take full responsibility for that. I tried to be the best mom that I could and I failed. I miss him every day,” Lavaughn Riley said to state District Judge Don Johnson after pleading guilty to conspiracy to commit manslaughter.

Johnson sentenced the 39-year-old Riley to 20 years in prison, minus the more than 6½ years she has spent behind bars since Xzayvion’s death in June 2012.

The boy died due to blunt-force trauma to his abdomen. An overwhelming infection caused by a ruptured bowel killed him.

Riley's guilty plea came three months after the boy's father, Michael Anthony Robertson, pleaded guilty to manslaughter and cruelty to a juvenile in return for a 40-year prison term. He too was given credit for the more than six years he spent in jail.

+4 Baton Rouge man pleads guilty, gets 40 years in 8-year-old son's 2012 beating death Six and a half years after 8-year-old Xzayvion Riley died due to blunt force trauma to his abdomen, the father of the Baton Rouge boy pleaded …

Robertson, 52, was Riley's boyfriend at the time of Xzayvion's death.

Riley testified against Robertson at a 2014 hearing that Xzayvion feared his father because he would hit and spank the boy to discipline him. Riley also admitted that she had beaten the boy on a previous occasion.

Xzayvion's half-sister told sheriff's deputies that Robertson beat her brother with his fist the day before he died, according to an affidavit of probable cause.

Sister of Xzayvion Riley testifies his father beat her brother Xzayvion Riley’s oldest sister calmly testified Friday that she saw the Baton Rouge boy’s father, Michael Anthony Robertson, discipline her br…

Riley said in court Thursday that she tried to check on Xzayvion the night before he died, but Robertson stopped her and said the boy was faking.

“It pains me to be here today because my child should have lived,” she said. “This will always haunt me.”

Riley said she knows “my baby’s OK” and hopes to see him in Heaven “so I can tell him I’m sorry for what you went through.”

She said her other children are now 9 and 17.

“I plan on being there (with them and for them) again,” Riley promised.

Her attorney, Margaret Lagattuta, told Johnson that Riley has cooperated completely with authorities ever since her son’s death.

“She did all of that without a deal, until today,” Lagattuta said.

East Baton Rouge Parish District Attorney Hillar Moore III said afterward that Riley’s plea reflected her culpability and her level of cooperation “in this tragic case.”

“The plea and sentence are appropriate under these circumstances,” he said.

Prosecutors have said Xzayvion suffered an escalating pattern of abuse.

The state Supreme Court ruled in 2016 that a jury would be allowed to hear about the abuse Robertson allegedly inflicted on his son, including injuring the boy’s mouth with a belt in 2008, choking him and shoving his head into a toilet in 2010, and breaking his leg in February 2012, just four months before his death.

His autopsy revealed dozens of external signs of recent and past trauma, including a human bite mark, officials said. The boy’s half-sister told authorities she saw Robertson bite Xzayvion on a regular basis as a form of discipline.