Two Iowa teenagers pleaded guilty to first-degree murder Tuesday in the deadly beating of their high school Spanish teacher. 

Willard Miller, 17, and Jeremy Goodale, 18, both changed their pleas to guilty, admitting they helped kill 66-year-old Nohema Graber, their Spanish teacher at Fairfield High School, in November 2021. Prosecutors say the beating ensued following a meeting Miller had with her over a poor grade he received in her class. 

Miller and Goodale, who were both 16 at the time of the killing, are accused of ambushing Graber in Chautauqua Park, where she was known to take daily walks. 

They then dragged her into the woods and beat her to death with a baseball bat, court papers allege. Prosecutors say evidence shows both teens struck Graber with the bat. However, Miller has denied ever hitting Garber, despite admitting he helped plan and carry out the killing. 

IOWA TEEN ACCUSED OF FATALLY BEATING TEACHER TO TESTIFY AGAINST CLASSMATE: REPORT

Willard Miller wears orange jumpsuit in courtroom

Willard Miller, 17, and Jeremy Goodale, 18, pictured here, both changed their pleas to guilty, admitting they helped kill 66-year-old Nohema Graber, their Spanish teacher at Fairfield High School, in November 2021. (Kyle Ocker/The Ottumwa Courier via AP, Pool, File)

Goodale testified that Miller initiated the plan to kill Graber, and they both struck her.

Witnesses saw Graber's van leaving the park less than an hour later with two males in the front seat.

Her body was found the next day hidden under a tarp, a wheelbarrow and railroad ties, documents say.

Graber's van was left at the end of a rural road. Investigators say Goodale and Miller were later picked up by a witness after receiving a call from Goodale. 

IOWA TEENS KILLED SPANISH TEACHER, 66, WITH BASEBALL BAT, NEWLY RELEASED COURT DOCS ALLEGE

A police interview shows Miller's frustration with Graber's teaching, with Miller saying his grade in her class would lower his GPA. 

Willard Miller wears orange jumpsuit in courtroom

Willard Miller is led into a courtroom, March 29, 2023, in Fairfield, Iowa, for a hearing related to the murder charge he faces in the 2021 death of Fairfield, Iowa, Spanish teacher Nohema Graber. (Kyle Ocker/The Ottumwa Courier via AP, Pool, File)

Prosecutors have agreed to recommend a sentence between 30 years and life in prison with the possibility of parole as part of an agreement with Miller and a sentence between 25 years and life with the possibility of parole for Goodale.

Willard Miller wears orange jumpsuit in courtroom

Prosecutors have agreed to recommend a sentence between 30 years and life in prison with the possibility of parole as part of an agreement with Miller as well as a sentence between 25 years and life with the possibility of parole for Jeremy Goodale, pictured here. (Kyle Ocker/The Ottumwa Courier via AP, Pool, File)

Goodale agreed in late March to testify against Miller during his trial, which is set to start later this week. 

CLICK HERE TO GET THE FOX NEWS APP

Both teens will be charged as adults due to the severity of the crime. They were not subject to a mandatory life sentence without parole due to their ages when the crime was committed.

Fox News' Rebecca Rosenberg and the Associated Press contributed to this report.