A West Michigan pastor pleaded guilty to a child accosting charge stemming from an undercover sting targeting sex predators.

David Robert Diehl was facing two charges, including a 20-year felony, for allegedly going on Craigslist “for the purpose of having sex’’ with an 11-year-old girl.

On Monday, he pleaded guilty to accosting children for immoral purposes. Diehl faces up to four years in prison when he returns to Kent County Circuit Court for sentencing.

Today’s plea came as his jury trial was to get underway before Kent County Circuit Court Judge Dennis Leiber.

Diehl was arrested in November following a probe by a police task force that investigates online sex predators. In this case, the forum was Craigslist.

Investigators say Diehl texted a person identified as Daddy Dave “regarding the possibility of meeting for sex’’ with Daddy Dave’s 11-year-old daughter, court records show. Daddy Dave was an undercover Michigan State Police trooper.

Diehl “admitted to having a sexual interest and curiosity in children around the age of 12-13 years old,’’ state police Trooper Matthew McLalin wrote in a probable cause affidavit.

“Diehl admitted there was a strong possibility he would have met with ‘Daddy Dave’ for the purpose of having sex with the 11-year-old girl if there was zero chance of Diehl being arrested by police or having to go to jail.’’

The 39-year-old Kentwood man has no criminal record; he was working for a Grand Rapids area funeral home and taking online classes at Regent University, court records show. Diehl was a pastor at Church of Fire in Grand Rapids, according to its website in November, but there is no mention in court records of Diehl being a pastor.

Members of the Internet Crimes Against Children Task Force searched Diehl’s apartment on South Creek Drive SE on Nov. 22. Diehl was not home; they caught up with him at work. Diehl “admitted to texting ‘Daddy Dave’ regarding the possibility of meeting for sex with his 11-year-old daughter,’’ court records show.

Make it easy to keep up to date with more stories like this. Download the WZZM 13 app now.

Have a news tip? Email news@wzzm13.com, visit our Facebook page or Twitter.