An aspiring rapper in the "horrorcore" genre pleaded guilty Monday to killing his 16-year-old girlfriend, her parents and her friend days after the adults chaperoned the teens at a music festival featuring artists rhyming about raping, killing and mutilating people.

Richard "Sam" McCroskey, 21, was sentenced to life in prison as part of his agreement to plead guilty to two counts of capital murder and two counts of first-degree murder. He initially was charged with four counts of capital murder, which could have resulted in the death penalty if convicted on the charges.

His attorney, Cary Bowen, said after the hearing that the prospect of a conviction on capital murder charges was a major factor in agreeing to the guilty plea.

"Four bodies are pretty compelling evidence," Bowen said. "This is the kind of stuff that citizens any place in this country are terrified it could happen to them. This is the kind of case death penalties arise from."

McCroskey, from Castro Valley, Calif., arrived at the Prince Edward County Circuit Court shackled, in a loose-fitting orange jumpsuit and under heavy guard. He did not look at family members gathered on side of the courtroom, and showed little emotion during the hearing. He replied "yes" and "no" to questions from the judge in Prince Edward County Circuit Court.

He declined to offer a statement in court but Bowen said his client was preparing a message to give to the victims' families. He described McCroskey's mood as "somber."

"There are four people dead here," Bowen said. "He's not happy at all."

McCroskey pleaded guilty to killing his girlfriend, 16-year-old Emma Niederbrock; her parents, Presbyterian minister Mark Niederbrock and Longwood University professor Debra Kelley; and Emma's 18-year-old friend, Melanie Wells of Inwood, W.Va. Their bodies were found last September in Kelley's home.

Family members and friends of the victims sobbed softly during the hearing in this college town 50 miles southwest of Richmond. They left without speaking to reporters, but issued a written statement: "We have endured a tragedy of unspeakable proportions. We are relieved that justice has been done.

"While we will never forget our loved ones or the circumstances of their deaths, we hope to move forward and begin the healing process."

Prosecutor James R. Ennis said that the women were bludgeoned with a wood-splitting tool — a maul — while they slept on Sept. 15, 2009. Mark Niederbrock was killed with the tool when he came to check on them a day and a half later.

Asked why McCroskey remained in the house, Bowen said, "I think he was contemplating suicide. He was contemplating what he had done, and not knowing what to do about it."

Ennis declined to speculate on a motive. "He's a closed individual," he said.

But Bowen said McCroskey had become increasingly angry with Emma and believed she "wasn't being loyal to him."

McCroskey and Emma Niederbrock shared an interest in the "horrorcore" genre, which sets violent lyrics over hip-hop beats.

McCroskey, a website designer and music promoter, had been rapping under the name "Syko Sam." He flew to Virginia to visit Emma, and her parents drove them and Wells to a horrorcore music festival in Michigan Sept. 12. Police found their bodies six days later after Wells' parents became worried that she didn't return home.

Bowen said McCroskey had confided to friends he had killed the four.

Asked if McCroskey's musical interests had fueled his rage, Bowen said, "Much of that music is so rampant with this exact kind of behavior, you can't help but notice the coincidence. But I don't have a sense the music led to this kind of behavior."

Ennis said McCroskey had no criminal record. He said he had discussed the plea agreement with the victims' families, and their sentiments played a role in structuring the plea.

"Anything can go wrong in a jury trial," he said. "Hopefully this can bring some measure of closure to the families."

On McCroskey's MySpace page, people have posted messages of support in recent weeks.

"free syko sam we need more tracks!!" reads a post under the name J.R.B. from last month.