One Texas mother who was monitoring her 9-year-old daughter’s cellphone exchanges helped police to catch a suspected pedophile when he drove from Grapevine to Justin to have sex with the girl Friday.

Jonathan Ashley Butler, 36, was charged with online solicitation of a minor after the Grapevine police arrested him following a set-up in which Butler thought he was going to be meeting the girl to engage in sexual activities, according to KDFW-TV. But when Butler arrived at the scene, he was met by the police.

The girl, who lives with her mother in a different city, would often visit her father at the Hilltop apartment complex in Grapevine — the same complex where Butler lived. Although it is still unclear exactly how Butler obtained the girl’s phone number, her father suggested that Butler may have obtained it through a teenager who reportedly babysat for both his daughter and Butler’s own daughter, according to KDFW. An investigation into the matter is still ongoing.

Butler’s troubles began when the 9-year-old’s mother, who often monitored her daughter’s mobile and online activities, noticed “inappropriate” texts from Butler that were sent to the girl’s cellphone, according to KDFW. Alarmed by what she read, the mother continued the conversation with Butler as if she were her daughter.

“The text messages became more and more inappropriate at that point,” Sgt. Robert Eberling from the Grapevine police told KDFW.

The girl’s mother told the police that after she began posing as her daughter during the back-and-forth text message exchange, Butler asked for sex within minutes, WFAA-TV reported. She then got the police involved and allowed an officer to continue the conversation with Butler as they began to set up how they could arrest him.

“The mother, doing what any good parent would do, occasionally runs through her phone and checks up on her, then noticed some strange messages,” Grapevine Police Lt. Barry Bowling told WFAA. ”We’re doing forensics on his cellphone and computers to determine if there are other victims that he already had relationships with.”

After his arrest, Butler was jailed on a $50,000 bond for online solicitation of a minor — a second-degree felony that is punishable up to 20 years in prison, WFAA noted.

Follow Kathryn Blackhurst (@kablackhurst) on Twitter