SALISBURY, N.C.-- A middle school teacher in Rowan County is facing charges for having an inappropriate relationship with a student. The investigation started Monday when a family member of the Erwin Middle School student file a complaint with the Rowan County Sheriff's Office. The person reported seeing inappropriate messages from the teacher to the child.

Detectives discovered the teacher was communicating with the student via Facebook messenger, and it involved content that placed the two in what appeared to be an online relationship.

The messages date back to September 9, 2017 and indicate the teacher, 42-year-old Mark Robert Dexter, was making plans for the student to come to his house. Detectives say there's no evidence that the meeting happened. Over the course of 8 days, thousands of messages were exchanged resulting in over 400 pages of evidence in the case.

Follow WFMY News 2 on Facebook and Twitter for more stories, updates

Investigators say date and timestamps of the messages show Dexter was sending messages, from his personal phone, while he was still at the school. The child involved is not a student in Dexter's, class and she was not known to him outside of the school. Dexter admitted to exchanging the messages with the victim after being confronted by a detective, the report says. Digital evidence from the victim and suspect’s electronic devices were obtained along with the data from Facebook.

A warrant was obtained Wednesday charging Dexter with taking Indecent Liberties with a Student. Investigators arrested him at his Granite Quarry home and he was placed in the Rowan County Detention Center under a $150,000 secured bond.