Arthur Eric Magana is scheduled for trial next week in the death of Wyatt Miller.

The trial of Arthur Magaña, 18, on a charge of first-degree murder is set to begin next week with jury selection, but the judge had to rule on an important issue Wednesday in an evidentiary hearing.

Homicide Detective Joe Bonucci took the stand in Pinal County Superior Court to talk about the night Magaña was arrested after the shooting death of Wyatt Miller, 20. That was Nov. 7, 2016, exactly two years before this week’s hearing.

In pre-trial paperwork, Magaña’s counsel had filed a motion to suppress statements, claiming a Miranda warning violation during interrogation. Judge Kevin White asked to hear the detective’s account of that night during Wednesday’s hearing before ruling on the matter.

Two days earlier, Magaña’s one-time co-defendant, Gustavo Olivo, was sentenced to 25 years in prison after reaching a plea agreement with the Pinal County Attorney’s Office. Olivo admitted to second-degree murder and armed robbery but said Magana was the gunman.

Magaña is charged with murder and armed robbery.

Wednesday, Miller’s father and Magaña’s mother attended the hearing.

Prosecutor Patrick Johnson asked Bonucci detailed questions about the night of the arrest in an effort to disprove the defense’s claims. Bonucci was the case agent and on-call detective. According to the Pinal County Sheriff’s Office, a report of shots fired was logged at 7:30 p.m. and deputies arrived shortly after.

At 8 p.m., Bonucci was called by his supervisor and sent to the scene on a rural road south of Maricopa. While en route, he was informed there were two locations being investigated. Miller’s body had been found in a Chevy pickup truck on Cardinal Road “a hundred yards or so from the nearest residence,” and two suspects had been found at a home on Oak Road.

Bonucci testified no deputies interrogated Magaña or Olivo at the scene. He said one teen was placed in a PCSO vehicle while the other was placed in an Ak-Chin Police vehicle during the preliminary investigation. Eventually, both were placed in a PCSO posse vehicle, and an investigation team member placed a digital recorder in the vehicle. Bonucci said the suspects, who were 16 and 17 at the time, were not questioned in the car, either.

The detective said they later found the digital recorder to have been tampered with or the batteries removed.

Magaña and Olivo were taken to PCSO in Florence, arriving at 3:13 a.m. Bonucci said they were taken to the second floor and placed in separate interview rooms across the hall from each other.

Having learned on the trip back to Florence that the teens were under age 18, Bonucci said his team employed juvenile protocol, which included contacting a legal guardian for each before interrogation. In Magaña’s case, his mother arrived and was soon taken to the interrogation room to be with her son.

It was at that point, Bonucci testified, Magaña was read his Miranda rights. He opted not to answer questions without an attorney, he said.

Meanwhile, Olivo was allowed to have a phone conversation with a sister who was not his legal guardian. Bonucci said Olivo answered some questions before also invoking his Miranda rights, and the interview stopped.

Bonucci testified the teens were placed in one interview room where they could be monitored by video and audio while the investigative team tried to work out whether to book them into juvenile detention or adult detention.

“We knew they would be remanded and charged as adults,” he said.

During the disagreement among the authorities (the teens were eventually booked into juvenile detention), Magaña and Olivo apparently had a conversation while they waited. Bonucci said investigators did not talk to them, they were not interrogated, questioned, coerced or threatened, but they were recorded.

“It’s an interview room,” Bonucci said. “The interview room is recorded.”

What was said during that one-on-one conversation in the interview room was at the heart of the motion to suppress.

White ruled the situation was not a Miranda issue and several statements made during that conversation could be used as evidence during the trial. The judge disagreed with the defense counsel’s argument that the teens’ conversation took place in an “ad hoc continuation of the interview” and should have been part of the invocation of Miranda rights.

White also said there was no “custodial interrogation” and no indication Olivo “was acting as an agent of the state” or trying to make Magaña make incriminating statements.

Jury selection is scheduled for Tuesday. White said he is confident the trial will be finished by Nov. 21.