Former Pine County religious leader Victor Barnard, who pleaded guilty to two counts of felony sexual assault, will get his prison sentence reduced by six years because of a judicial technicality, under a state Court of Appeals ruling Monday.

Barnard, 56, was sentenced last year to 30 years in prison for assaulting two girls whose families were among his followers in the River Road Fellowship. The assaults, which occurred in the 2000s, were brought to light years after the two left the fellowship.

Although the presumptive sentence was 24 years in prison, Barnard and attorneys on both sides agreed on the 30-year statutory maximum sentence for the two counts under a plea agreement. He had been charged with 59 counts of criminal sexual conduct, but pleaded guilty to two.

Barnard later appealed, and a three-judge appeals panel ruled Monday that because the court did not provide reasons for departing from the presumptive sentence at the time of sentencing — either orally or in writing — the longer sentence could not be upheld.

"Although we have no doubt that permissible departure grounds exist in this case, because the district court did not provide any departure grounds on the record at the time of sentencing, case law compels us to remand for imposition of the presumptive sentence," the court decision said. "We are obligated to follow the law."

Pine County Attorney Reese Frederickson said he plans to appeal the ruling to the Minnesota Supreme Court. The agreed-upon sentence was "thoroughly stated on the record" by both parties, he said.

"It's a judicial clerical error," Frederickson said. "They're saying the penalty for that is to take away six years for a sex offender's sentence."

Barnard is being housed out of state, according to a state Department of Corrections spokeswoman. Early this year, he was beaten in prison by another inmate.