One of the two men accused of starting their own fundamentalist Mormon offshoot, and of marrying each other’s daughters, on Wednesday agreed to serve at least 25 years in prison.

Samuel Shaffer, 34, pleaded guilty to rape of a child and child abuse in 5th District Court in Cedar City.

The rape charge is a first-degree felony that carries 25 years to life in prison. The child abuse count carries up to 15 years in prison.

A court docket entry says Shaffer will be sentenced April 10.

Child kidnapping counts were dismissed as part of a plea agreement. However, Shaffer still faces four felony and one misdemeanor counts in Sanpete County, including charges of child sodomy and bigamy. His next court appearance there is scheduled for March 7.

This undated photo provided by Sanpete County Jail shows John Coltharp. Police say Utah men Coltharp and Samuel Shaffer are under arrest after a search near a remote, makeshift compound turned up two girls taken by their father, Coltharp, to join an upstart sect relatives say is based around polygamy and doomsday. Iron County Sheriff's Lt. Del Schlosser said Tuesday, Dec. 5, 2017, the girls aged 4 and 8 were found cold but uninjured after deputies combed the desert near the makeshift compound made of storage containers on Monday. (Sanpete County Jail via AP)

After Wednesday’s hearing, Iron County Attorney Scott Garrett said it will be up to the judge whether Shaffer serves consecutive or concurrent prison sentences. All the victims in the case approved of the plea agreement, Garrett said.

“We’re thrilled with the outcome — get the maximum penalty and make it so those children don’t have to appear in court and testify and be revictimized,” Garrett said.

Shaffer and John Coltharp, 34, were arrested in December and charged with kidnapping. They hid Coltharp’s children from his ex-wife, triggering an Amber Alert, according to court and law enforcement documents.

The children were later found with Shaffer in a rural part of Iron County where he was living in a makeshift home constructed from shipping containers.

Shaffer and Coltharp, according to the documents, founded a religious group called Knights of the Crystal Blade with fundamentalist Mormon teachings. They also believed the end of the world was nearing and Muslims would invade the United States. Garrett on Wednesday said he’s not aware that Shaffer and Coltharp had any followers.

Coltharp appeared in court in Manti on Wednesday afternoon, waived his right to a preliminary hearing and pleaded not guilty to all counts. He has a pretrial hearing scheduled for March 21.

(Pool Photo) John Coltharp did not accept a plea offer when he appeared in court on Wednesday Feb. 21, 2018.