An Alabama father who shot and killed his daughter’s sexual abuser pleaded guilty Monday and accepted a 40-year prison sentence in the hopes of sparing his daughter from having to relive the experience through a lengthy trial.

Jay Maynor, 43, was sentenced to 20 years in prison in the June 2014 killing of 59-year-old Raymond Earl Brooks. Brooks was a registered sex offender who was shot to death at his home in rural Cullman County, north of Birmingham.

BREAK IN CASE? POLICE SEARCH FOR SUV IN RELATION TO JOGGER'S DEATH

Brooks pleaded guilty in 2002 to sexually abusing Maynor's young daughter. He served 27 months of a five-year sentence and paid restitution.

“Basically he took it so that I didn’t have to relive the molestation and also be on the stand in front of a bunch of people talking about and bringing back memories of the molestation,” the woman told AL.com. “My father was protecting me, like a father should do. He is an amazing father—actually the best. He loves us so much.”

TOURIST WHO CLAIMED SHE WAS RAPED IN DUBAI IS CHARGED WITH EXTRAMARITAL SEX

The shooting reportedly was prompted by a conversation Mayor had with his daughter about the abuse.

“It was just something I said out of anger to my father,” she said.

Investigators said the father also shot at a man who had been dating his stepdaughter, but the man was able to hide inside a convenience store. His daughter said the man at the convenience store was abusive to the stepdaughter.

The father then drove to Brooks' home, where he killed him. Maynor also was sentenced to 20 years in prison for the first shooting.

His daughter said that she suffered daily from memories of the abuse. “I’m going through hell,” she said.

The Associated Press contributed to this report.