HELENA, Mont. — An eastern Montana judge who has been criticized for handing down a suspended prison sentence in an incest case defended his decision in a statement released Friday.

District Judge John McKeon said Valley County prosecutors did not challenge a psychosexual evaluation that said the 40-year-old defendant could be safely treated and supervised in the community. The plea agreement that recommended at least a 25-year prison sentence allowed for a lesser sentence depending on the results of the evaluation, he noted.

McKeon criticized news coverage of the case, saying it failed to note that state law allows for an exception to the mandatory 25-year prison sentence for incest involving someone age 12 or younger if a psychosexual evaluation finds treatment “affords a better opportunity for rehabilitation of the offender and for the ultimate protection of the victim and society.”

The exception is consistent with one of Montana’s stated sentencing policies “to encourage and provide opportunities for an offender’s self-improvement, rehabilitation and reintegration back into a community,” McKeon wrote.

The victim’s mother and grandmother also wrote letters asking that the defendant not be sentenced to prison, he noted.

The victim’s mother wrote that while the defendant made a horrible choice, he needs help, not a prison sentence. She added that he has two sons that still love him and that she would like to see her “children have an opportunity to health the relationship with their father.”

The girl’s grandmother also called the defendant’s conduct “horrible,” but said his children, “especially his sons, will be devastated if their Dad is no longer part of their lives.”

Nobody spoke on behalf of the 12-year-old girl during the sentencing hearing, Deputy Valley County Attorney Dylan Jensen said Friday.

“Her family declined to testify,” he said in an email to The Associated Press. The AP is not naming the defendant to avoid identifying the victim.

McKeon also noted that the defendant’s suspended sentence has numerous restrictions including complying with sex-offender treatment and making regular contact with his probation officer. He must have the approval of his treatment providers and probation officer before having any contact with the victim or anyone under 18 years of age. He also may not access pornographic material and can have only limited access to computers and the internet.

“All district judges take an oath to uphold the Constitution and laws of this state,” McKeon concluded. “These constitutional provisions and laws include certain fundamental legal principles that apply at sentencing, including a presumption of innocence for unproved criminal allegations, the varying sentencing policies and the government’s burden to counter evidence supporting an exception to mandatory sentence.”

The plea agreement called for two other counts of incest to be dismissed.

Criticism of the sentence has come down on social media. An online petition suggesting McKeon should be impeached had gathered more than 4,000 signatures by Friday afternoon.