Michael Ray McLellan admitted to kidnapping Aguilar from her driveway and then killing her and disposing of her body. He was sentenced to life in prison without the possibility of parole.
He also pleaded guilty to charges of attacks on two other unrelated victims, which occurred in October 2016 and July 2018.
McLellan tried twice to escape from his prison guards -- before and after the hearing.
"I was in the courtroom when he pleaded guilty and gave a little statement to the family and everything, but now, I see all of that was just for show," said Robeson County Sheriff Burnis Wilkins. "He had an escape plan in his mind the entire time."
Wilkins said he wasn't exactly surprised this happened, and said he was thankful his deputies took swift action with a dangerous person.
"By the grace of God, nothing bad happened," Wilkins said. "It could have been a very tragic situation."
Wilkins had beefed up security going into Friday's court hearing.
"We knew McLellan had nothing to lose in this situation," Wilkins said.
FULL COVERAGE OF THE CASE
The sheriff said McLellan first tried to break free while being driven to court using a makeshift handcuff key.
Deputies were able to stop that plan along Interstate 40. But on the way back to prison, McLellan hit a latch of a deputy's gun holster and the weapon was released. Wilkins said at one point, McLellan "actually had possession of the gun."
He said the deputy driving slammed on the brakes and was able to get a hand on the gun as McLellan was pulling it back.
"Little fight took place right there for the gun, and the passenger, detention officer, sprayed him with pepper spray," Wilkins said. "He immediately released the gun and limped back into the seat and said, 'You got me, you got me.'"
McLellan is being held in a high-security area at North Carolina Central Prison in Raleigh.
Wilkins told ABC11 he will speak with the district attorney to determine whether additional charges will be filed.
"Everyone in the Lumberton Police Department is humbled and grateful to bring justice for Hania, her family and this community. This case has shown our relentless commitment and tireless efforts to hold violent criminals accountable for their actions," Lumberton Police Chief Michael McNeill said.
Timeline
On Nov. 5, 2018, Aguilar was abducted outside her Lumberton home. A man wearing a black and yellow bandana forced her into a stolen SUV while she was warming up her family's car to go to school.
Timeline: Lumberton teen Hania Aguilar missing since Nov. 5
Her body was discovered weeks later at the bottom of a shallow pond, about 10 miles from where she was abducted.
About 10 days later, the FBI and Lumberton Police Department arrested McLellan -- who was already in custody for charges related to a different case -- in connection to her kidnapping. Then, McLellan's DNA connected him to an unrelated, unsolved rape case from October 2016.
It was revealed investigators had McLellan's DNA and the rape kit from 2016 case before Aguilar was kidnapped.
Missed DNA in 2016 rape case likely cost Hania her life, DA says
A Robeson County Sheriff's Office investigator was later fired and a second employee resigned. Wilkins did not say the Aguilar case was the reason for their firing, but he did say before the end of the investigation that they were being investigated in connection to Aguilar's case.
Robert M. DeWitt, the FBI Special Agent in charge of North Carolina, said: "We hope Hania's family and McLellan's other victims are in some way comforted knowing he will spend the rest of his life in prison for his vicious crimes."