The white sedan cruised past the gray, three-story rental home on a dead-end street in Moscow, Idaho. Then again. And again.

It was unusual behavior in the residential, hillside neighborhood in the quiet hours before dawn. And according to a police affidavit released Thursday, surveillance videos showing the vehicle that November night were key to unraveling the gruesome mystery of who killed four University of Idaho students inside the house.

With little else to go on as a panicked community demanded answers, investigators canvassed security footage from the neighborhood — including one recording of the car speeding away after the slayings — to get a sense of the killer’s possible movements, the affidavit said.

Eventually, the document said, police were able to narrow down what was at first known only vaguely as a white sedan to a 2015 Hyundai Elantra registered to Bryan Kohberger, a 28-year-old doctoral student in criminology at Washington State University, just across the border in Pullman, Washington. Further investigation matched Kohberger to DNA at the crime scene, it said.

Kohberger made an initial appearance in an Idaho courtroom on Thursday following his extradition from Pennsylvania, where he was arrested last week. His attorney didn’t immediately respond to a request for comment, though a public defender who represented him in Pennsylvania, Jason LaBar, has said he is eager to be exonerated and should not be tried “in the court of public opinion.”

“Tracking movements in public is an important technique when you haven’t identified any suspects,” said Mary D. Fan, a criminal law professor at the University of Washington. “You can see movements in public even if you don’t have probable cause to get a warrant. We live in a time of ubiquitous cameras. This is a remarkable account of what piecing together that audiovisual data can do.”

The car’s first pass by the home was recorded at 3:29 a.m. on Nov. 13 — less than an hour before Kaylee Goncalves, Madison Mogen, Xana Kernodle and Ethan Chapin were stabbed to death in their rooms, Moscow Police Cpl. Brett Payne wrote in the affidavit.

The vehicle drove by twice more and was recorded a fourth time at 4:04 a.m., Payne wrote. It wasn’t seen on the footage again until it sped away 16 minutes later.

“This is a residential neighborhood with a very limited number of vehicles that travel in the area during the early morning hours,” Payne wrote. “Upon review of the video there are only a few cars that enter and exit this area during this time frame.”

A forensic examiner with the FBI determined the car to likely be a 2011-13 Hyundai Elantra, though subsequently said it could be a model as late as 2016, according to the affidavit.

Surveillance footage from the Washington State University campus offered further tantalizing information: A similar vehicle headed out of town just before 3 a.m. on the day of the killings and reappeared on cameras in Pullman just before 5:30 a.m., the affidavit said.

On Nov. 25, the Moscow Police Department asked regional law enforcement to look for a white Elantra. Three nights later, a WSU police officer ran a query for any white Elantras on campus.

One came back as having a Pennsylvania license plate and being registered to Kohberger. Within half an hour, another campus officer located the vehicle parked at Kohberger’s apartment complex. It came back as having Washington state tags. Five days after the killings, Kohberger had switched the registration from Pennsylvania, his home state, to Washington, the affidavit said.

Investigators now had a name to go on, and further investigation yielded more clues. Kohberger’s driver’s license described him as 6 feet tall and 185 pounds, and his license photo showed him to have bushy eyebrows — all details consistent with a description of the attacker given by a surviving roommate, the affidavit said.

More research revealed that Kohberger had been pulled over by a Latah County, Idaho, sheriff’s deputy in August while driving the Elantra. He gave the deputy a cellphone number.

Armed with that number, Payne obtained search warrants for the phone’s historical data. The location data showed the phone was near his home in Pullman until about 2:42 a.m. on the morning of the killings. Five minutes later, the phone started using cellular resources located southeast of the home — consistent with Kohberger traveling south, the affidavit said.

There was no other location data available from the phone until 4:48 a.m., suggesting Kohberger may have turned it off during the attack in an effort to avoid detection, the affidavit said. At that point, the phone began taking a roundabout route back to Pullman, traveling south to Genesee, Idaho, then west to Uniontown, Washington, and north to Pullman just before 5:30 a.m. — around the same time the white sedan showed back up on surveillance cameras in town.

It remains unclear why the victims were targeted.

Kohberger opened the account for the phone on June 23, the affidavit said, and location data showed that he had traveled to the neighborhood where the victims were killed at least a dozen times before the attacks. Those visits all came late in the evening or early in the morning, the affidavit said, and it was on one of those trips that he was pulled over by the sheriff’s deputy on Aug. 21.

The cellphone data also included another chilling detail, the affidavit said: The phone returned to the victims’ neighborhood hours after the attack, around 9 a.m. But even though one of the surviving housemates had seen a strange man inside and heard crying after 4 a.m., the killings were not reported to police until later that day, and there was no police response at the scene by 9.

Though police had realized Kohberger, with his 2015 Elantra, was a person of interest by Nov. 29, they issued a news release on Dec. 7 asking for the public’s help in finding a white 2011-13 Elantra. They suggested such a vehicle had been near the home early on Nov. 13 and that any occupants “may have critical information to share regarding this case.”

It wasn’t clear why police issued that request, but law enforcement agencies sometimes use such public statements to throw off suspects and keep them from learning they’re under suspicion. Tips poured in and investigators soon announced they were sifting through a pool of around 20,000 potential vehicles.

Kohberger apparently remained at WSU until mid-December, when he drove to his parents’ house in Pennsylvania, accompanied by his father, in the Elantra. While driving through Indiana, Kohberger was pulled over twice on the same day for tailgating.

On Dec. 27, police in Pennsylvania recovered trash from the Kohberger family home and sent DNA evidence to Idaho, the affidavit said. The evidence matched the DNA found on the button snap of a knife sheath recovered at the crime scene, it said.

Kohberger is charged with four counts of first-degree murder and felony burglary. A status hearing in the case is set for Jan. 12.

___

AP Correspondent Rebecca Boone in Boise, Idaho, contributed.