Daniel Reilly, a former Marine who discharged with honors in 2000, has been charged with several accounts of both first and second degree rape and seven counts of endangering the welfare of a child after text messages between him and a former student were reportedly discovered.

NBC News reports on the charges against Irish American Reilly, who was working as a middle school English teacher in Queens, New York until the charges came about.

According to police reports, Reilly and the student were using code names on their cell phones while carrying on their sexual relationship. Some reports, though not yet validated, say that Reilly hosted the female student in his home, one that he shares with his wife and newborn child.

Police say the relationship began this past November, with the latest encounter happening this month.

The student’s older sister discovered the explicit texts and told her family about it, prompting them to contact police.

Margie Feinberg, a spokeswoman for the Department of Education, said Reilly had been a teacher at the school for five years. He was reassigned pending the outcome of the investigation, she said.

On Tuesday, Reilly’s wife, an attorney, posted the $50,000 bail after his arraignment. His attorney, Eric Franz, said Reilly returned home to his wife and 11-month-old child after the court appearance.

Reilly is due back in court next month. If found guilty, he could face up to seven years in prison for his crimes.

Parents who have children in the school were shocked to hear the news. Reilly was reportedly a favorite teacher amongst the students in the school.