Minutes after she was declared competent, Hansen accepted a plea bargain.
Hansen was originally charged with first-degree felony murder, for which the maximum penalty is life in prison. On Wednesday, she pleaded guilty but mentally ill to charges of manslaughter and felony discharge of a firearm, second-degree felonies each punishable by a maximum of 15 years.
To further evaluate her mental state, Hansen will be committed to the Utah State Hospital for several months before she is sentenced. It is likely she will serve a portion of her sentence while continuing treatment at the hospital.
"Ms. Hansen recklessly shot her daughter twice with a handgun, causing her death," defense attorney Heidi Buchi told the court, explaining the factual basis for the guilty pleas.
Hansen's 18-year-old daughter, Virginia Ray Hansen, died on March 22. After shooting the teen twice, Hansen turned the gun and shot herself in the head.
She reportedly drove up the street, told a neighbor about killing her daughter, and then returned home, where paramedics found her.
Family friends have told The Salt Lake Tribune that Mary Hansen had health and financial problems at the time of the shooting.
She is scheduled to be sentenced on May 8.