The engineer of the 2015 Amtrak crash in Frankford rejected a plea offer Thursday that could have spared him the possibility of spending years behind bars.

Instead, Brandon Bostian told a Philadelphia judge that he wanted to roll the dice at trial, allowing a jury to decide if he was guilty of charges including causing a catastrophe, eight counts of involuntary manslaughter, and more than 200 counts of reckless endangerment.

The decision by Bostian, 38, marked the beginning of his trial over the fatal wreck, which left eight people dead and more than 200 injured. After Bostian rejected the offer, Common Pleas Court Judge Barbara McDermott moved forward with jury selection and empaneled eight women and four men to hear testimony expected to begin Friday.

Prosecutors, led by Senior Deputy Attorney General Christopher Phillips, have accused Bostian of causing the fatal derailment nearly seven years ago. Bostian accelerated Train 188 to 106 mph — twice the speed limit — before a curve, an action the Attorney General’s Office contends was criminally reckless.

But Bostian’s lawyers, led by Brian McMonagle, have argued that the crash was a tragic mistake, calling Bostian an otherwise conscientious engineer who became disoriented while listening to radio chatter about rocks being thrown at nearby trains.

McDermott told Bostian on Thursday that he had been offered the opportunity to enter a “no contest” plea to nine counts of reckless endangerment, a close equivalent to pleading guilty. In return, McDermott said, prosecutors would have dropped all other charges, including the lead charge of causing a catastrophe, a felony.

She did not say if the plea came with a recommended sentence but told Bostian that by rejecting it he was exposing himself to the potential of “more than a lifetime of incarceration.”

Bostian, without elaborating, said he had considered the offer and decided against it.

His case has wound a twisted path through the criminal justice system — largely due to the question of whether his conduct amounted to a crime.

Judges have twice dismissed all charges, ruling that Bostian’s conduct was not criminal, but prosecutors each time have successfully appealed and revived the case.

The Attorney General’s Office has not said what sentence it might seek if Bostian is convicted on all counts.

While questioning prospective panelists Thursday, McDermott asked if any of them had heard about this case — a standard screening inquiry — and nearly all of them indicated that they had.

One woman said she didn’t believe she’d be able to rule impartially, admitting to McDermott that she did not believe Bostian should have been charged. At least one other prospective juror also was dismissed after saying he knew one of the injured victims.

Opening arguments were expected to begin Friday morning, and testimony was likely to continue into next week.