STAMFORD — A former theater teacher at a Greenwich private school accused of sending inappropriate texts to a 15-year-old student has been denied a probation program that would have wiped the arrest from his record.

Jesse Lozano, 25, of Brooklyn, N.Y., was charged in July with felony risk of injury to a child

Judge John Blawie and Assistant State’s Attorney Susan Campbell said Lozano sent sexually explicit text messages to a student.

“Thankfully, they never met up, although there were discussions. They were planning on meeting up at his home in Brooklyn,” Campbell said as the teen’s parents sat in the front row of the Stamford courtroom on Wednesday.

Lozano’s attorney Alan Friedman told the judge his client is a passionate student and teacher of theater arts who worked on Broadway. Friedman said the text messages were out of character for Lozano.

Friedman said Lozano, who was freed following his arrest, sent the text messages in an effort to explain the meanings of some plays to the student. Friedman said his client should not have been so blunt with a young student.

“It’s not discussing plays per se, it’s the explicit nature of the plays and the topics discussed that ran it off the rails,” Blawie told Friedman. “A drama teacher can obviously discuss plays with students.”

Friedman said his client cooperated with police and did not deny having the discussions with the student.

But Blawie cited the seriousness of the accusations in denying Friedman’s request for Lozano to participate in an accelerated rehabilitation program.

“Based on his relationship as the teacher and her as the student, she needed to be protected from such predatory behavior,” Blawie said. “I can’t make the finding that I must make that this was not of a serious nature and I am denying your application.”