A former Montgomery County karate instructor agreed to serve a 6½-year prison sentence Wednesday after admitting to sexually abusing teenage students on out-of-state trips to martial arts tournaments in Maryland and New York.

Evan Burgess, 28, of Blue Bell, had been accused of molesting four teens he groomed during lessons at the Conshohocken studio where he worked. He later pursued them on social media and during overnight hotel stays between 2014 and 2016, often while another adult was sleeping in the same room.

All of the teens reported waking up while sharing a bed with their instructor to find him performing sexual acts on them.

He agreed to plead guilty to charges of traveling across state lines to engage in illicit sexual activity as part of a deal struck with prosecutors guaranteeing his 6½-year sentence if U.S. District Judge Timothy J. Savage signs off on it at a hearing scheduled for October.

Savage’s OK would spare Burgess the 11 to 14 years he could have faced under federal sentencing guidelines.

In federal court in Philadelphia on Wednesday, the former karate teacher sat just a few feet from some of his accusers and their families as prosecutors described in detail the crimes to which he was admitting.

Asked by the judge how he was feeling, Burgess calmly replied: “I’m a bit anxious, but I’m OK.”

The hearing took place nearly two years after Burgess was fired by DeStolfo’s Premier Martial Arts Studio in Conshohocken when the allegations against him came to light. Burgess had been at the martial arts school for nearly two decades, first as a student enrolled in karate lessons at age 8 and later as a paid instructor.

His accusers described Burgess — whose Facebook page is plastered with photo galleries of his students, some shirtless — as an unusually attentive teacher. He often asked his underage students for their cellphone numbers and social media accounts so he could text or contact them through platforms such as Snapchat, they said.

“Burgess was closer to the younger students than any other karate instructor at the studio had ever been,” one accuser told investigators, according to court filings. “He would hang out with the students, go to the movies with them, and have them sleep over at his parents’ house,” where he was living.

And during out-of-town trips to karate tournaments, prosecutors said, it was common for Burgess to ask to share hotel rooms with his students and their parents, claiming he could not afford a room of his own.

On one of those trips, to a 2016 tournament in National Harbor, Md., Burgess admitted, he pulled down the pants of one of his accusers while he was asleep and began grinding against him in an attempt to initiate sex. Burgess’ father was asleep in the room’s other bed.

The boy, who was 16 at the time and in the courtroom Wednesday, told investigators he immediately jumped out of bed, left the hotel, and spent the rest of the night wandering the streets.

Another student said that in 2014, when he was 15, he woke up while staying in a hotel with Burgess during a tournament in East Elmhurst, N.Y., to find his teacher groping his genitals through his clothing.

The boy’s mother, also staying in the room, awoke and witnessed the act, prosecutors said. Although she dismissed it in the moment, thinking that she must have dreamed it, prosecutors said Wednesday that she later confronted Burgess about what she saw.

He “told her that he had a sleepwalking problem where he sometimes does sexual things in his sleep,” Assistant U.S. Attorney Kelly M. Harrell said.

Burgess, however, denied that conversation took place and asked that references to it be stricken from the record of Wednesday’s proceedings. Prosecutors did not challenge his request, saying the account was not necessary to sustain Burgess’ conviction.

Burgess already is serving a minimum three-year sentence in state prison after being convicted this month on similar charges involving teens he abused during sleepovers in the basement of his parents’ home.

Because those assaults did not involve interstate travel, Montgomery County prosecutors opted to pursue them in state court under a little-used charge — sexual assault by a sports official.

In drafting the statute creating that crime in 2014, then-State Rep. Mike Vereb said he had hoped to specifically address situations involving teenagers who were older than 16, Pennsylvania’s age of consent, yet still susceptible to grooming tactics and sexual molestation by authority figures.

Burgess’ lawyer, federal public defender Elizabeth Toplin, said Wednesday that her client was eager to take responsibility for his crimes.