CHRISTIANSBURG, Va. -- A former Virginia Tech student convicted of fatally stabbing a 13-year-old girl said he was sorry before he was sentenced to 50 years in prison. David Eisenhauer was an 18-year-old freshman studying engineering when he developed a relationship with Nicole Lovell, a 7th-grader in Blacksburg.

Prosecutor Mary Pettitt said Eisenhauer and Lovell communicated online for months before meeting at least once in person. Pettitt said they met again in January 2016, when Eisenhauer lured Lovell out of her family's apartment with the promise of a "secret date," then killed her because he was afraid she would expose their relationship.

David Eisenhauer, right, during his sentencing hearing in a Virginia courtroom June 27, 2018 WDBJ

"48 Hours" investigated the case in the episode, "Killer App." Investigators determined Lovell had been communicating over the messaging app Kik with someone using the screen name, "Dr_Tombstone." Using an IP address provided by the app after a disclosure request, the FBI traced the username to Eisenhauer.

Get Breaking News Delivered to Your Inbox

Before the sentence was handed down by Judge Robert Turk, Eisenhauer apologized.

"I am sorry for the pain my actions have caused for Nicole Lovell and her family," he said.

Prosecutors asked for a life sentence, while Eisenhauer's lawyers asked for something within sentencing guidelines that call for a prison term of between about 24 years and nearly 40 years.

Natalie Keepers, a friend of Eisenhauer's whom prosecutors have identified as his accomplice, is scheduled to stand trial in September on charges of being an accessory before the fact and concealing a body. Prosecutors have said that Keepers told police Eisenhauer told her he feared Lovell could be pregnant. Keepers said Eisenhauer told her he may have had sex with Lovell at a party, but couldn't remember because he blacked out and later woke up in a ditch.

In a surprise move, Eisenhauer pleaded no contest to first-degree murder, abduction and concealing a body during the fourth day of testimony at his trial in February. Eisenhauer's lawyer had attempted to shift the blame to Keepers during opening statements. Keepers told police she and Eisenhauer talked about various ways to kill the girl and that she had helped dump her body after Eisenhauer stabbed her. She insisted that she wasn't present for the actual killing, but Eisenhauer's lawyers suggested she was there and could have been the one who killed Lovell.

The no contest plea means Eisenhauer acknowledges there's enough evidence to convict him, but doesn't admit he committed the crime. It has the same effect as a guilty plea.

Lovell's body was found after several days of searching just over the state line in North Carolina. A medical examiner testified that she had 14 stab wounds, including a lethal wound to her neck.

"Your whole world just comes tumbling down, because she was my everything," Lovell's mother, Tami Weeks, told "48 Hours."

Before Eisenhauer's sentence was imposed, Lovell's parents described how their daughter's killing has affected them.

Her father, David Lovell, said he's been diagnosed with severe depression and post-traumatic stress disorder since his daughter's death.

"There is nothing that will happen in this courtroom that will fix it," he said.

Weeks said she sees a grief counselor and still has trouble sleeping. She said she celebrated what would have been her daughter's 16th birthday last month at her gravesite.

Eisenhauer's lawyers called two teachers and a former classmate of his from Yakima, Washington, where he lived before moving with his family to Columbia, Maryland. Both teachers from the Riverside Christian School said he was a smart and kind student, but appeared to have trouble following social cues.

Kathryn Anne Stoothoff, who taught Eisenhauer in a 10th-grade English class and a bible class, said he was bright, but "needed clear rules to be successful." She said Eisenhauer would "follow someone off a cliff if they convinced him it was the right thing to do."