Senior Deputy District Attorney John Barrick said the plea was part of an agreement for Lopez to testify at Chavez’s trial. If Lopez upholds his agreement, prosecutors are expected to dismiss the second-degree murder charge against him.

“It’s really important that the story of Kimberly’s life be told fully at trial,” Barrick said outside the courtroom Tuesday. “Everyone has to know how she lived and died.”

Barrick said he couldn’t tell that story without one of Kimberly’s parents testifying. He declined to provide details about Lopez’s account of what happened but called it “horrifying.”

Lopez’s attorney Phil Capritto declined to comment Tuesday on the guilty pleas and his client’s agreement to testify.

A few of the 30 investigators from different law enforcement agencies who worked on the case were in court Tuesday when Lopez changed his plea.

Authorities began searching for Kimberly in July 2016 when Ventura County Children and Family Services said it received information something might be wrong. Staff members from the agency attempted to contact her at her home several times but couldn’t find her. They reported her missing to Oxnard police on Sept. 7, 2016.

A new dependency case was opened for Kimberly, who had been removed from her parents’ care twice before and placed into foster care. A county social worker last saw Kimberly on March 10, 2015, at her Oxnard home. She had been placed in Lopez’s custody with Chavez allowed to have supervised visits.

Authorities now believe Kimberly died on June 22, 2015. She had just turned 3.

Her parents have been in jail since October 2016, after a judge held them in contempt for allegedly failing to tell authorities where their daughter was or what had happened to her.

Lopez and Chavez previously told authorities Kimberly was alive the last time they saw her. After they spent months in jail, the story changed, police said.

When the parents were questioned in August, they apparently told detectives Kimberly hurt her head while Chavez was trying to change the girl’s pants. Kimberly suffered two seizures after she was injured and her parents sought no medical treatment, the parents said, according to authorities. She died later that night and the parents drove her body to Mexico, authorities said the parents told them.

Barrick said the girl’s remains have not been found. He said it’s unusual for there to be a child murder case without a body.

Chavez is due in court on Wednesday to be arraigned on perjury charges stemming from her testimony during the dependency court proceedings. She was ordered to stand trial on those charges after a preliminary hearing earlier this month.

She is also scheduled to appear in court Thursday for a preliminary hearing in the murder case.

Barrick said Lopez is not expected to testify at that hearing.

As part of the plea agreement, Lopez faces a maximum of 14 years in prison for the perjury and child endangerment charges, should he fully cooperate, Barrick said. He is scheduled to be sentenced Sept. 12.