LACONIA, N.H. (CBS/AP) — A man who kidnapped a 14-year-old girl when she accepted his offer of a ride home from school because her feet were sore, held her captive for nine months and raped her repeatedly at his trailer acknowledged his crimes on Thursday and apologized.

The girl, who was in court to hear his admission, thanked him for eventually letting her go.

READ MORE: Worcester Remembers 6 Firefighters Killed 22 Years Ago In Cold Storage Fire

Nathaniel Kibby pleaded guilty to seven counts including kidnapping, aggravated felonious sex assault and criminal threatening. He was sentenced to 45 to 90 years in prison.

Kibby, who had pleaded not guilty after his arrest, had been scheduled to go on trial next month on nearly 200 felony charges related to the girl’s October 2013 disappearance and the months that followed. But he changed his pleas to guilty at a hearing on Thursday.

Before the 35-year-old Kibby entered his new pleas, a prosecutor said Kibby had kidnapped the girl by offering her a ride home from her school and then brandishing a gun when she tried to get out of his car.

Prosecutor Jane Young said the girl and Kibby didn’t know each other and she accepted the ride because she’d worn boots to school that day and her feet were blistered.

Young said when the girl tried to get out of the car in a parking lot Kibby pulled out the gun and threatened to “blow her brains out” and slit her throat.

Last week, a judge ruled Kibby’s lawyers could not question the girl before his trial about her exposure to media coverage of the case and the amount of freedom she was given to move about his trailer in Gorham, where prosecutors say he used a stun gun, zip ties and a shock collar to control her.

Kibby was charged with kidnapping the girl on Oct. 9, 2013, as she walked home from her high school in Conway. The girl returned to her home in North Conway the night of July 20, 2014.

Young said Kibby released the girl because he was convinced he’d “terrorized her enough” that she wouldn’t reveal his identity.

READ MORE: Boston Police Warn About Drinks Being Spiked With Drugs At Bars

The girl waited until a week after she was home to reveal Kibby’s name, which she had seen inside a cookbook in his home.

Kibby apologized for the decisions he made and said he didn’t want to discuss his feelings in front of the journalists in the courtroom.

Young said that early in the girl’s captivity Kibby instructed her to write a misleading letter home in an effort to throw off authorities, who’d launched a massive search for her.

The girl still had fake nails at the time and carved his identity and vehicle information into the letter, but he caught on, zapped her with a stun gun as punishment and made her write a new letter.

Lawyers hired by the girl’s family said she had suffered “numerous acts of unspeakable violence” during her months of captivity. Their statement was largely a plea for privacy and did not elaborate on what she endured.

During the hearing Thursday, the victim said, “It was not my choice to go to your house. It was not my choice for you to rape me.”

“Some people might call you a monster, but I’ve always looked at you as human and I want you to know that even though life became a lot harder after that, I still forgive you,” she said.

WBZ-TV’s Jim Smith contributed to this report.

MORE NEWS: Coronavirus In Massachusetts: Today's Developments

(TM and © Copyright 2016 CBS Radio Inc. and its relevant subsidiaries. CBS RADIO and EYE Logo TM and Copyright 2016 CBS Broadcasting Inc. Used under license. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed. The Associated Press contributed to this report.)