A teacher who ran for Congress this year sexually abused a 14-year-old female student while the two were alone in the classroom in 2014 and 2015, according to police. The man and the girl also exchanged nude photos, charging documents say.

Maxwell Bero, a teacher at Watkins Mill High School, was arrested on Wednesday and charged with sexually abusing the student when he taught at Col. E Brooke Lee Middle School. Police gave few details, but said in a press release Wednesday that the abuse happened after school hours on campus.

Bero ran against incumbent Rep. David Trone for Maryland’s Sixth District seat in Congress in the June 2 Democratic primary.

According to charging documents, the victim, who is now 19, was in a class with Bero when she was 14 and starting eighth grade at the Silver Spring middle school.

Police said Bero taught her history class and during her lunch period, she and other students would get help from Bero with assignments. The victim, police said, talked about family issues with Bero.

Police said Bero communicated about assignments through the messaging app Kik Messenger and he frequently exchanged messages with the victim.

Bero, now 30, sent a nude photo of himself to the victim while he was at his bachelor party in late 2014 and she sent one back of herself, charging documents say. Police said the two continued to exchange nude photos and messages of “sexual fantasies” for the rest of the school year.

Charging documents says Bero and the student often met alone at the end of the school day in his classroom, under the pretext that she needed help with assignments or needed service-learning hours.

The sexual abuse occurred during these meetings, police said. Sometimes it happened in front of a supply closet door that blocked the view from the hallway, and other times, the classroom door was locked, police said.

Communication between Bero and the victim continued during her freshman year of high school, but stopped on June 17, 2016, police said.

Bero has been charged with one count of sexual abuse of a minor and six counts of third-degree sex offense.

On Thursday in District Court, Judge Patricia Mitchell released Bero on $10,000 unsecured bond on the condition that he remain under pretrial services supervision and not have unsupervised contact with minors, including his daughter.

Mitchell also ordered that Bero not have access to electronic communication.

During Thursday’s hearing, Assistant State’s Attorney Gordon King said authorities are concerned about communications Bero might have had with other students because he posted his Kik screen name in the front of the classroom.

“The presence of electronics in the home is of primary concern to the state because the defendant has shown he is willing to engage minors in surreptitious communication to groom them for abuse,” King said.

Bero’s attorney, Rene Sandler, said during Thursday’s hearing that he cooperated with detectives, The Washington Post reported.

Sandler told Bethesda Beat in emails Wednesday and Friday that she would release a statement at a later date.

Bero’s next court hearing is scheduled for Oct. 9. He has been placed on administrative leave from the school system.

Dan Schere can be reached at daniel.schere@bethesdamagazine.com