The surprise plea came just as the trial for Matthew Stevens was ready to get underway with jury selection.
While potential jurors were waiting on one floor of the Lackawanna County Courthouse, Stevens was on another floor with his family members, making his decision to plead guilty.
Just after noon, the 32-year-old pleaded guilty to one count of corruption of minors, a felony, which means he could potentially spend up to seven years behind bars.
Prosecutors say they, and the victim, were ready to move forward to trial before the surprise plea.
"The process is never easy, especially for the victims," Deputy District Attorney Jennifer McCambridge said. "I mean, the length of time, the times they have to testify, it's never easy but they were willing to do it."
Stevens was charged in February 2013 with having sexual contact with a 17-year-old female student.
In a previous court hearing, she testified most of the contact happened at Lakeland Junior-Senior High School, in Stevens' office, a drum closet, a uniform closet, practice rooms and even behind the high school stage.
During the investigation, a second girl came forward saying Stevens had inappropriate contact with her too when he was working previously at the Western Wayne School District. She was ready to testify at the trial as well.
No charges were ever filed in regards to her allegations and as a part of Stevens' plea deal, they won't be.
"There will not be any additional charges based on information that's currently in our possession," McCambridge said.
Prosecutors say this case was troubling because of the position of trust Stevens held as a teacher and band director in the community.
"It really should be considered a sacred position in society. They have, sometimes students or kids are spending more time with teachers than they are with their own parents so we take that position very seriously," McCambridge said. "The law does, as law enforcement we do and I thikn that's what made this conduct that much more unacceptable."
In addition to possible prison time, Stevens will also have to register for Megan's Law for 15 years.
His sentencing date has not been set.
Steven's attorney declined to answer questions about why his client decided to plead guilty right before trial. He said he will answer questions after Stevens has been sentenced in Lackawanna County.
Copyright 2016 Nexstar Broadcasting, Inc. All rights reserved. This material may not be published, broadcast, rewritten, or redistributed.