A crafty Iowan posed as a 15-year-old boy to expose her son-in-law as a sexual predator looking to meet up with underage kids, court documents show.

Ryan Mitchell Budde, 34, of Clinton, promised his wife that he’d stop chatting with teen boys online and asking them to send pictures, but relatives weren’t convinced that he stopped, according to court records cited by the Des Moines Register.

That prompted Budde’s mother-in-law to put on her detective’s hat and set up a sting that would ultimately be used as evidence to send Budde to prison for more than 10 years, court documents show.

“Budde’s mother-in-law took it upon herself to conduct an undercover investigation where she pretended to be a 15-year-old boy and began to communicate with Budde online,” the documents state. “Budde, within two weeks, expressed an interest in meeting this ‘boy’ for sex.”

Budde was sentenced on Tuesday to 130 months in prison for receiving and distributing child pornography. The investigation into his online activities started in 2017 after he uploaded 27 child porn files to Tumblr, Department of Justice officials in Iowa announced Wednesday.

A total of 365 images of child porn were later found on cellphones and laptops belonging to Budde, who also had chat sessions with young boys in which he posed as a 15-year-old virgin, authorities said.

Budde admitted having an “unhealthy attraction” to male teens in a sentencing document filed last week, but his attorney insisted in court records that he never actually had any physical contact with minors.

Police also found no evidence that Budde did anything inappropriate as a volunteer for Big Brothers Big Sisters of America, his attorney wrote in court documents.

Budde’s chat sessions with young boys led to a divorce and termination of his parental rights, the Quad-City Times reports.