CASPER, Wyo. — A Wyoming judge has sentenced a 20-year-old man to life in prison for the rape and attempted murder of a 4-year-old girl last year.

District Judge Thomas Sullins on Friday sentenced Brandtly Bedsaul, of Casper, to 60 years to life for attempted murder and 40 to 50 years for first-degree sexual abuse of a minor. The sentences will run consecutively.

The judge said the long sentence made sense in part because of the young age of the victim and the effect the attack has had on her life.

Bedsaul apologized to his victim and her family and to his own family. He says he’ll seek substance-use treatment.

Casper police arrested Bedsaul in October 2016 after they received a report of man raping a girl in his front yard.