KATY, Texas -

A former Morton Ranch High School teacher and coach appeared before a judge on a felony charge of engaging in an improper relationship with a student.

Daimon Sweet, 44, resigned from his position at the high school after learning about the investigation.

Katy ISD officials told Local 2 the 44-year-old was a world history teacher and the interim boy's basketball coach when the alleged relationship with a 17-year-old occurred. An anonymous letter to the school's administrators prompted the investigation.

Sweet appeared before a judge on Wednesday night. In court, prosecutors said the relationship began back in January and the student admitted to police she and Sweet would meet at a hotel and have sex.

Prosecutors said hotel records, text messages and nude photos on the student's phone were obtained as evidence.

Sweet is being held on $30,000 bail.

A letter went home on Thursday to all Morton Ranch parents, reading:

"Today, June 4, a former Morton Ranch High School world history teacher, who also served as the boys' interim basketball coach, was arrested by Katy ISD police for allegedly engaging in an inappropriate relationship with a 17-year-old female student.

"Daimon Sweet has been charged with a second-degree felony for improper relationship between educator and student. The investigation was prompted by an anonymous letter delivered to a Morton Ranch High School administrator on Thursday, May 15 alleging an improper relationship between the 44-year-old teacher and a 17-year-old student.

"The teacher resigned from his position effective immediately on May 19. Parents of the students who were involved in the investigation were contacted directly.

"In Katy ISD, the safety and security of all students is of the upmost importance, and the district will continue to do everything it can to ensure a safe and productive learning environment for all students."