A Texas woman was sentenced to life in prison after pleading guilty Wednesday to shooting and killing her two young daughters in 2017.

Prosecutors declined to pursue the death penalty against Sarah Nicole Henderson in exchange for her pleading guilty to two counts of capital murder in the deaths of her 5- and 7-year-old daughters.

Henderson, 31, has been in custody since her November 2017 arrest at her home near Mabank, about 50 miles (80 kilometers) southeast of Dallas. She confessed when talking to investigators and said she had been planning to kill the girls and her husband for several weeks, Henderson County Sheriff Botie Hillhouse said at the time. She also told investigators she planned to kill herself, he said.

Henderson shot the girls in the head while they were sleeping in the living room. She tried to shoot her husband, Jacob Henderson, but the gun malfunctioned, Hillhouse said. She was charged with attempted murder, but the charge was dropped as part of her plea deal with prosecutors.

Jacob Henderson, who was not the girls' biological father, initially called 911 that day seeking medical help for his wife. He told operators that she wouldn't listen to him and that she was, "freaking out like someone is out to get her," according to a recording of the call.

He called back a few minutes later to cancel the call, saying that his wife told him she was feeling fine and that she was acting normally. Deputies still responded to the house and the couple told them they were OK and didn't need help.

Jacob Henderson called 911 again a few hours later to report that his wife had shot the girls. He could be heard sobbing and asking why she had done it.

Sarah Henderson was heard in the background asking her husband to kill her or shoot her, saying people were after her and that they were coming. At one point in the recording she yelled, "God, what did I do?"

Henderson sought an insanity defense last year, but she was found competent to stand trial, Tyler TV station KETK reported.