A former Arkansas prison chaplain accused of raping inmates based his classes on the teachings of the evangelical minister who influenced the Duggar family’s homeschooling of their 19 children.

Kenneth Dewitt was charged last week with 50 counts of third-degree sexual assault after investigators accused him of pressuring three inmates at a women’s state prison into providing him with sexual favors, reported The Daily Beast.

The chaplain was strongly influenced by Bill Gothard, the disgraced founder and former head of Institute of Basic Life Principles — who resigned over sexual harassment claims made against him.

Gothard established the popular Basic Youth Conflicts program in the 1970s that focuses on seven Bible-based life principles, and he also created the homeschooling program Advanced Training Institute promoted by the reality TV stars Jim Bob and Michelle Duggar.

The couple contacted Gothard after they caught their eldest son, Josh, molesting his sisters as a teenager, and the minister encouraged them to send the boy to do construction work with a “godly mentor” he selected.

“As a person who has actually been through the Basic Seminar, I am confident that these are some of the best programs available for instilling character into the lives of people,” Huckabee, now a GOP candidate for president, said when Gothard’s organization began running prison ministries in Arkansas.

The 67-year-old Dewitt founded the faith-based Principles and Applications for Life program rooted in Gothard’s teachings about 16 years ago, when Huckabee was governor.

The charges came after a former inmate who later worked for Dewitt said she began a relationship with the chaplain after she was paroled — which would have violated the Department of Corrections policy against relationships between managers and subordinates.

Dewitt resigned, and three inmates came forward to report that he had sexually assaulted them.

The former chaplain faces up to 10 years in prison if convicted on each Class C felony.

Five women sued Gothard’s Institute in Basic Life Principles in October, accusing the organization and its board of directors of enabling and covering up sexual abuse and harassment of interns, employees and participants in its programs.

Gothard is not facing any criminal charges at this time, and the board of directors said they hoped to welcome him back someday to the organization he founded.

The U.S. Department of Justice is conducting an unrelated sexual abuse and harassment investigation of the McPherson Unit in Newport, where Dewitt worked.