A middle-school teacher in Fort Worth, Texas, was arrested Tuesday for sharing sexually explicit image of a young girl through Kik, a messaging app.

The incident came to light after the messaging app flagged the image. After verifying that it was child pornography, the app immediately alerted the police. Following this, officers traced the IP address to the accused, identified as 35-year-old Stephen Corkill, and executed a search warrant at his home.

During the search, the officers found a phone with the app installed. When questioned, the accused said he had an account on the app and that he used it to view child pornography. Following this, the man was taken into custody.

On Wednesday, he appeared in court and was charged with “transporting a depiction of a minor engaged in sexually explicit conduct via interstate commerce.” The accused could face up to 20 years in federal prison if found guilty of the crime.

Meanwhile, the U.S. attorney’s office for the Northern District of Texas said the accused taught the seventh grade at Marine Creek Middle School. Investigation into the case was ongoing.

In a similar incident earlier this month, a physical education teacher at an Illinois school was arrested on child pornography charges. According to the affidavit, the accused identified as 56-year-old Douglas Mynatt, worked at Urbana's University High School. In January this year, he distributed and received images of child pornography. These included images of girls who were as young as six years old. The accused was taken into custody and charged with possessing child pornography. He could face up to 20 years in federal prison if convicted.

Representational image of a man in handcuffs.