One of two Iowa teenagers charged in the fatal beating of their high school Spanish teacher was sentenced on Thursday to 35 years in prison with the possibility of parole, officials said.

Willard Miller, 17, stood in the Jefferson County Courthouse in Fairfield, where he apologized to the family of the victim, Spanish teacher Nohema Graber, who was 66 when Miller and another teen, Jeremy Goodale, now 18, killed her on Nov. 2, 2021. 

Miller and Goodale were both 16 when they pursued Graber to Chautauqua Park, a park she frequented and beat her to death because she gave Miller a poor grade, prosecutors said. The teens pleaded guilty to murdering Graber and concealing her body under a tarp and wheelbarrow in a wooded area of the park.

"I would like to apologize for my actions, first and foremost to the family," Miller said during the sentencing hearing, which lasted more than seven hours. "I am sincerely sorry for the distress I have caused you and the devastation I have caused your family."

HUMAN SKULL REPORTEDLY FOUND AT IOWA PARK

Willard Miller speaking

Willard Miller makes a statement to the family of Nohema Graber during his sentence hearing at the Jefferson County Courthouse in Fairfield, Iowa, on Thursday, July 6, 2023.  (Jim Slosiarek/The Gazette via AP)

In his remarks, Miller also apologized to the Fairfield community, his own family, Goodale's family and the police.

"I'm realizing just the magnitude of my actions, and I know it's wrong and I knew it was wrong and yet I still carried through," he continued. "I still did what I did, and I accept responsibility for that."

IOWA MAN SHOT, KILLED BY DEPUTY IN DOMESTIC DISPUTE CALL GONE WRONG

Miller pleaded guilty to the murder in April and, as part of the plea agreement, prosecutors recommended Miller receive a term of between 30 years and life in prison, with the possibility of parole.

Graber's family friend

A family friend, center, holds the hand of Nohema Marie Graber, the daughter of murdered Fairfield High School Spanish teacher Nohema Graber, as they listen to testimony during the sentencing of Willard Miller at the Jefferson County Courthouse in Fairfield, Iowa, on Thursday, July 6, 2023.  (Jim Slosiarek/The Gazette via AP)

Goodale is set to be sentenced in August, but his lawyers are seeking a delay.

Fairfield is located about 100 miles southeast of Des Moines.

IOWA POLICE OFFICER CLINGS TO HOOD OF CAR DURING DRAMATIC CHASE, SUSPECT SENTENCED TO 5 YEARS

During Thursday’s hearing, District Court Judge Shawn Showers acknowledged Miller's age but also noted he had "cut Nohema Graber’s precious life short," dealing a blow to her family and the community.

"I find that your intent and actions were sinister and evil. Those acts resulted in the intentional loss of human life in a brutal fashion," Showers said. "There is no excuse."

Willard Miller and his attorney

Willard Miller sits with his attorneys during his sentence hearing at the Jefferson County Courthouse in Fairfield, Iowa, Thursday, July 6, 2023.  (Jim Slosiarek/The Gazette via AP)

Several of Graber's relatives read or submitted victim impact statements to the court describing her as a kind, caring woman who was devoted to her family, students and church.

Goodale testified that he and Miller planned the murder for about two weeks and that both of them hit the victim and then hid her body.

CLICK HERE TO GET THE FOX NEWS APP

Goodale also testified that the plan was initiated by Miller, who admitted to helping but denied hitting Graber.

The two were charged as adults.

The Associated Press contributed to this report.