A teacher at a West Chester charter school specializing in performing arts has been arrested after investigators said he groomed a former student into having a sexual relationship with him.

Seth Reich, 40, was charged late Thursday with institutional sexual assault, unlawful contact with minors, and corruption of minors, court records show.

Reich, of Downingtown, was released after posting $25,000 bail. It was unclear if he had hired an attorney. He did not respond to a request for comment.

Chester County District Attorney Deborah Ryan called Reich’s conduct — which allegedly took place during his tenure as a theatre instructor at Pennsylvania Leadership Charter School Center for Performing and Fine Arts — “an egregious violation of trust and an abuse of his position of authority as a teacher.”

“It took great courage for the victim to come forward and report what happened to her as a 17-year-old student,” Ryan said.

Representatives from the school did not return a request for comment. Reich is not listed among the school’s faculty on its website, but it’s unclear if he’s still employed there.

The victim, now 19, reported the abuse to West Goshen Township police on Wednesday, according to the affidavit of probable cause for Reich’s arrest. She told detectives that Reich initially offered to help her with her studies at the school and offered her private acting lessons.

Gradually, those lessons became more intimate, with Reich acting “flirty” toward her, the woman told police. At one point, Reich invited her to his office alone, and the two had sex, a routine they repeated at least four more times on the school’s campus, the affidavit said.

The two continued having sex after the victim left the school, ending it in March, according to the affidavit. In the presence of a detective, it said, the victim called Reich and told him she had misgivings about their relationship. During the call, Reich apologized, saying he knew what they did was wrong but “couldn’t help it at the time,” according to the affidavit.

Detectives later searched the victim’s phone and discovered explicit text messages and images exchanged by the two over the course of the last few years, the affidavit said.

Reich is scheduled to appear for a preliminary court hearing later this month.