A doctoral student who went from studying crime scenes and serial killers to being charged in the mysterious murders of four Idaho college students pleaded guilty Wednesday as part of a deal that spared him from the death penalty.

The agreement reached between prosecutors and the suspect, Bryan Kohberger, was a surprise twist in a case that has spawned books, documentaries and years of social media speculation since November 2022, when four University of Idaho students were stabbed to death in the middle of the night in a home near campus.

But while the deal resolved the question of whether Kohberger, 30, would admit to the four murders, it also raised significant new ones. Among them were whether a motive would ever be revealed, since Kohberger had no known connection to the victims, and whether Kohberger would ever discuss how he had carried out the crime and evaded arrest for more than six weeks.

At the hearing Wednesday, Kohberger, wearing brown pants and a shirt and tie, answered a series of questions from Judge Steven Hippler.

“Are you pleading guilty because you are guilty?” the judge asked. “Yes,” Kohberger responded, seated at a table beside his lawyers.

Bill Thompson, the prosecutor in charge of the case, read a basic account of the crimes and of Kohberger’s attempts to cover his tracks, including gutting the inside of his car and leaving his apartment nearly empty. But he did not provide a motive.

Thompson said that Kohberger’s phone appeared to be in the area around the victims’ home 23 times in the months before the crime, but that prosecutors did not have evidence that Kohberger had contact with the home or its residents during that time.

He did, however, suggest that Kohberger may have not entered the home planning to kill as many people as he did.

“We will not represent that he intended to commit all of the murders that he did that night, but we know that that is what resulted,” Thompson said. He said there was no evidence of any sexual component to the crimes.

Some victims’ family members were angered by the deal and said they had hoped that prosecutors or the judge would require Kohberger to divulge details of the crime and prohibit him from writing a book on the case. Kohberger is scheduled to be sentenced July 23, with families of the victims expected to address the court.

The family of Kaylee Goncalves, one of the victims, said in a post on Facebook on Wednesday before the hearing that the prosecution had showed “no spine, no shred of honor,” in offering the deal.

But family members of two other victims supported the deal.

The plea hearing in Boise, Idaho, was a turning point in a grisly drama that was only increasing in intensity as the trial, which had been set to begin in August, drew nearer.

At the time of the crimes, Kohberger was a few months into a criminology program at Washington State University, about a 15-minute drive from the crime scene in Moscow, Idaho. He had moved there from Pennsylvania, where he was raised and where he had recently completed a master’s program in criminal justice, during which he had surveyed criminals about their emotions and thoughts while they carried out their past crimes.

Investigators have said he drove around the victims’ home on King Road before entering the house and going into two bedrooms around 4 a.m., where he fatally stabbed four college students: Goncalves, 21; Madison Mogen, 21; Xana Kernodle, 20; and Ethan Chapin, 20.

Police were not called to the house for more than seven hours after the crime despite the fact that a surviving roommate had seen a man clad in black walking out of the house during the night. The roommate had sought refuge downstairs with another roommate, according to court records, but no one called 911 until late that morning, when a friend came to the house and discovered the gruesome scene upstairs.

Although he was not on the radar of lead investigators for weeks, police were eventually able to track Kohberger down, in part because they said his DNA had been found on a knife sheath left at the crime scene. Investigators used genetic genealogy to build a family tree and arrested him a few days after Christmas at his parents’ home in the Pocono Mountains region of Pennsylvania.

As Kohberger sat in jail for more than 2½ years, prosecutors disclosed additional evidence piece by piece in court filings.

Under the plea deal outlined by prosecutors, Kohberger would serve four consecutive life sentences and waive his rights to appeal. “We hope that you may come to appreciate why we believe this resolution is in the best interests of justice,” prosecutors wrote in a letter this week to victims’ families.