A 20-year-old Montana woman who threatened her former boyfriend with a machete and forced him to have sex with her has been sentenced to spend the next 20 years in a psychiatric facility.

Samantha Ray Mears was sentenced Tuesday for the June 2018 attack, the Great Falls Tribune reports.

She had broken into her ex-boyfriend’s Great Falls home armed with a machete last year when he wasn’t home She hid behind his bedroom door, waiting for him to return When he came home, she popped out wielding the weapon and forced him to have sex, KFBB-TV reported last year. She bit him on the arm and didn't stop when he asked her to. She also held the blade to his neck as she told him to remove his clothing, the Great Falls Tribune previously reported.

The victim said he complied out of fear.

After the assault, Mears sat naked on the bed with the machete, which the victim was able to photograph and later give to investigators. Mears then purposely peed in his bed and ripped a piece of trimming from his bedroom wall before he escaped and got help, according to KFBB.

samantha mears Photo: Cascade County Jail

Just two months prior to this heinous incident, Mears was charged with felony strangulation for another attack against the same victim, according to the Great Falls Tribune.

Mears’ lawyer Mark Frisbie said his client suffers from mental health issues and learning disabilities, which he said contributed to the attacks. She was previously deemed unfit to stand trial, which placed the case on hold.

During her 20-year commitment, Mears will also have to undergo sex offender programming and she will be designated a tier 2 sex offender, according to the Great Falls Tribune.